summaryrefslogtreecommitdiff
path: root/ota-test/misc/Makefile.header
diff options
context:
space:
mode:
Diffstat (limited to 'ota-test/misc/Makefile.header')
-rw-r--r--ota-test/misc/Makefile.header44
1 files changed, 44 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