From ec0b1526abdb8a628a98d9e33029cb48ae3bd17d Mon Sep 17 00:00:00 2001 From: dongheng Date: Mon, 19 Aug 2019 17:37:25 +0800 Subject: [PATCH] fix(ota): fix OTA binary which is to be flashed error --- components/esp8266/Makefile.projbuild | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/esp8266/Makefile.projbuild b/components/esp8266/Makefile.projbuild index 95b46485..246a3625 100644 --- a/components/esp8266/Makefile.projbuild +++ b/components/esp8266/Makefile.projbuild @@ -119,13 +119,14 @@ app2-flash-all: app2 @$(ESPTOOLPY_WRITE_FLASH) $(patsubst $(APP_OFFSET),$(APP2_OFFSET),$(ESPTOOL_ALL_FLASH_ARGS)) $(OTA1_BIN): all_binaries + @cp $(RAW_BIN) $(RAW_BIN).old @cp $(RAW_BIN) $(OTA1_BIN) @echo [GEN] $(OTA1_BIN) $(OTA2_BIN): $(OTA1_BIN) ifdef __COMBILE_OTA_BIN @rm -f ./build/esp8266/esp8266_out.ld - @export CFLAGS= && export CXXFLAGS= && make APP_OFFSET=$(APP2_OFFSET) APP_SIZE=$(APP2_SIZE) + @export CFLAGS= && export CXXFLAGS= && make $(APP_BIN) APP_OFFSET=$(APP2_OFFSET) APP_SIZE=$(APP2_SIZE) endif @cp $(RAW_BIN) $(OTA2_BIN) @echo [GEN] $(OTA2_BIN) @@ -150,6 +151,8 @@ ifdef CONFIG_ESP8266_OTA_FROM_OLD ota: $(OTA_V2_TO_V3_BIN) else ota: $(OTA_BIN) + @cp $(RAW_BIN).old $(RAW_BIN) + @rm $(RAW_BIN).old endif ota-clean: