diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-07 08:02:01 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-07 08:02:01 +0200 |
commit | 9b46055f142649d8bad251b030884c76d66b32ab (patch) | |
tree | 7223ac10e27b4ee18ad226b0d87dff31a2859965 /ota-test/misc | |
parent | beca53b79fd595da46da779a20464c333d63e3a0 (diff) | |
download | modern-esp-sandbox-9b46055f142649d8bad251b030884c76d66b32ab.tar.gz modern-esp-sandbox-9b46055f142649d8bad251b030884c76d66b32ab.tar.bz2 modern-esp-sandbox-9b46055f142649d8bad251b030884c76d66b32ab.tar.xz modern-esp-sandbox-9b46055f142649d8bad251b030884c76d66b32ab.zip |
wip
Diffstat (limited to 'ota-test/misc')
-rw-r--r-- | ota-test/misc/Makefile.header | 44 | ||||
-rw-r--r-- | ota-test/misc/header.c | 9 | ||||
-rw-r--r-- | ota-test/misc/header.ld | 12 | ||||
-rw-r--r-- | ota-test/misc/main-Kconfig | 20 |
4 files changed, 85 insertions, 0 deletions
diff --git a/ota-test/misc/Makefile.header b/ota-test/misc/Makefile.header new file mode 100644 index 0000000..5b62dc0 --- /dev/null +++ b/ota-test/misc/Makefile.header @@ -0,0 +1,44 @@ +IDF_PATH ?=../thirdparty/ESP8266_RTOS_SDK + +all: build/header.bin + +build/header.elf: header.c header.ld + xtensa-lx106-elf-gcc -ffreestanding -nostdlib -I ../thirdparty/rboot -Theader.ld -o $@ $< + +build/header.bin: build/header.elf + xtensa-lx106-elf-objcopy --output-target=binary $< $@ + hd $@ + +BAUD=115200 +BAUD=512000 +FLASH_ESPTOOL=python $(IDF_PATH)/components/esptool_py/esptool/esptool.py \ + --chip esp8266 \ + --port /dev/ttyUSB0 \ + --baud $(BAUD) \ + --before default_reset \ + --after hard_reset \ + write_flash \ + -z \ + --flash_mode qio \ + --flash_freq 40m \ + --flash_size 4MB + +flash-boot: + $(FLASH_ESPTOOL) \ + 0x0 build/rboot.bin + 0x3FC000 $(IDF_PATH)/components/esp8266/firmware/esp_init_data_default.bin + +flash-1: build/header.bin +# $(FLASH_ESPTOOL) 0x2000 build/header.bin +# $(FLASH_ESPTOOL) 0x2010 build/ota_test.bin + +flash-2: build/header.bin +# $(FLASH_ESPTOOL) 0x82000 build/header.bin +# $(FLASH_ESPTOOL) 0x82010 build/ota_test.bin + +flash-all: + $(FLASH_ESPTOOL) \ + 0x0 build/rboot.bin \ + 0x2000 build/ota_test.bin \ + 0x82000 build/ota_test.bin \ + 0x3FC000 $(IDF_PATH)/components/esp8266/firmware/esp_init_data_default.bin diff --git a/ota-test/misc/header.c b/ota-test/misc/header.c new file mode 100644 index 0000000..27e685d --- /dev/null +++ b/ota-test/misc/header.c @@ -0,0 +1,9 @@ +#include <rboot-private.h> + +rom_header header = { + .magic = ROM_MAGIC_NEW1, + .count = 2, + .flags1 = 0xaa, + .flags2 = 0x55, + .entry = (void *)0xdeadbeef +}; diff --git a/ota-test/misc/header.ld b/ota-test/misc/header.ld new file mode 100644 index 0000000..33579b6 --- /dev/null +++ b/ota-test/misc/header.ld @@ -0,0 +1,12 @@ +MEMORY +{ + RAM : org = 0x0, len = 0x10 +} + +SECTIONS +{ + .header : + { + *(.data) + } > RAM +} diff --git a/ota-test/misc/main-Kconfig b/ota-test/misc/main-Kconfig new file mode 100644 index 0000000..1d5f736 --- /dev/null +++ b/ota-test/misc/main-Kconfig @@ -0,0 +1,20 @@ +menu "Main: OTA Test" + +choice MAIN_APP + prompt "Select which app to build" + default MAIN_APP1_C + help + Select which bootloader to use + +config MAIN_APP1_C + bool "App 1" +config MAIN_APP2_C + bool "App 2" +endchoice + +config MAIN_APP + int + default 1 if MAIN_APP1_CHOICE + default 2 if MAIN_APP2_CHOICE + +endmenu |