summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ota-test/misc/Makefile.header44
-rw-r--r--ota-test/misc/header.c9
-rw-r--r--ota-test/misc/header.ld12
-rw-r--r--ota-test/misc/main-Kconfig20
-rw-r--r--ota-test/sdkconfig12
m---------thirdparty/rboot0
6 files changed, 91 insertions, 6 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
diff --git a/ota-test/sdkconfig b/ota-test/sdkconfig
index b0ed00c..9ada3d2 100644
--- a/ota-test/sdkconfig
+++ b/ota-test/sdkconfig
@@ -17,14 +17,14 @@ CONFIG_ESPTOOLPY_PORT="/dev/ttyUSB0"
CONFIG_ESPTOOLPY_BAUD_57600B=
CONFIG_ESPTOOLPY_BAUD_115200B=
CONFIG_ESPTOOLPY_BAUD_230400B=
-CONFIG_ESPTOOLPY_BAUD_256000B=y
-CONFIG_ESPTOOLPY_BAUD_460800B=
+CONFIG_ESPTOOLPY_BAUD_256000B=
+CONFIG_ESPTOOLPY_BAUD_460800B=y
CONFIG_ESPTOOLPY_BAUD_512000B=
CONFIG_ESPTOOLPY_BAUD_921600B=
CONFIG_ESPTOOLPY_BAUD_2MB=
CONFIG_ESPTOOLPY_BAUD_OTHER=
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
-CONFIG_ESPTOOLPY_BAUD=256000
+CONFIG_ESPTOOLPY_BAUD=460800
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_FLASHMODE_QIO=y
CONFIG_FLASHMODE_QOUT=
@@ -36,11 +36,11 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
CONFIG_ESPTOOLPY_FLASHFREQ_26M=
CONFIG_ESPTOOLPY_FLASHFREQ_20M=
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
-CONFIG_ESPTOOLPY_FLASHSIZE_2MB_C1=y
-CONFIG_ESPTOOLPY_FLASHSIZE_4MB_C1=
+CONFIG_ESPTOOLPY_FLASHSIZE_2MB_C1=
+CONFIG_ESPTOOLPY_FLASHSIZE_4MB_C1=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=
-CONFIG_ESPTOOLPY_FLASHSIZE="2MB-c1"
+CONFIG_ESPTOOLPY_FLASHSIZE="4MB-c1"
CONFIG_ESPTOOLPY_BEFORE_RESET=y
CONFIG_ESPTOOLPY_BEFORE_NORESET=
CONFIG_ESPTOOLPY_BEFORE="default_reset"
diff --git a/thirdparty/rboot b/thirdparty/rboot
-Subproject 74a59df752bff765c29b4e9aa7ada07cc422682
+Subproject 74220029ed6b28a8fb771bca9fa3235da34136a