feat(ota): Add OTA binary link address verify of ESP8285 or ESP8266 + 1MB flash

This commit is contained in:
Dong Heng
2019-01-24 15:32:24 +08:00
parent df4c82f394
commit 2e9cb80033
3 changed files with 35 additions and 6 deletions

View File

@ -94,7 +94,7 @@ OTA_V2_TO_V3_BIN := ./build/$(PROJECT_NAME).v2_to_v3.ota.bin
CONFIG_APP2_OFFSET ?= $(CONFIG_APP1_OFFSET)
CONFIG_APP2_SIZE ?= $(CONFIG_APP1_SIZE)
OTA1_OFFSET := CONFIG_APP1_OFFSET
OTA1_OFFSET := $(CONFIG_APP1_OFFSET)
ifdef CONFIG_ESP8266_BOOT_COPY_APP
OTA2_LINK_OFFSET := $(CONFIG_APP1_OFFSET)
else
@ -102,7 +102,7 @@ OTA2_LINK_OFFSET := $(CONFIG_APP2_OFFSET)
endif
$(OTA2_BIN): all_binaries
ifeq ($(CONFIG_ESPTOOLPY_FLASHSIZE), "1MB")
ifneq ($(OTA1_OFFSET), $(OTA2_LINK_OFFSET))
@rm -f ./build/esp8266/esp8266_out.ld
@make APP_OFFSET=$(OTA2_LINK_OFFSET) APP_SIZE=$(CONFIG_APP2_SIZE) CFLAGS= CXXFLAGS=
endif
@ -110,16 +110,16 @@ endif
@echo [GEN] $(OTA2_BIN)
$(OTA1_BIN): all_binaries
ifeq ($(CONFIG_ESPTOOLPY_FLASHSIZE), "1MB")
ifneq ($(OTA1_OFFSET), $(OTA2_LINK_OFFSET))
@rm -f ./build/esp8266/esp8266_out.ld
endif
@make APP_OFFSET=$(CONFIG_APP1_OFFSET) APP_SIZE=$(CONFIG_APP1_SIZE) CFLAGS= CXXFLAGS=
@make APP_OFFSET=$(OTA1_OFFSET) APP_SIZE=$(CONFIG_APP1_SIZE) CFLAGS= CXXFLAGS=
@cp $(RAW_BIN) $(OTA1_BIN)
@echo [GEN] $(OTA1_BIN)
$(OTA_BIN): $(OTA1_BIN) $(OTA2_BIN)
@cp $(OTA1_BIN) $(OTA_BIN)
ifeq ($(CONFIG_ESPTOOLPY_FLASHSIZE), "1MB")
ifneq ($(OTA1_OFFSET), $(OTA2_LINK_OFFSET))
@cat $(OTA2_BIN) >> $(OTA_BIN)
endif
@cp $(OTA1_BIN) $(RAW_BIN)