Skip to content

Commit 54bab58

Browse files
committed
Merge branch 'bugfix/fix_ota_bin_error' into 'master'
ota: fix OTA binary which is to be flashed error See merge request sdk/ESP8266_RTOS_SDK!1061
2 parents 8680849 + ec0b152 commit 54bab58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/esp8266/Makefile.projbuild

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@ app2-flash-all: app2
119119
@$(ESPTOOLPY_WRITE_FLASH) $(patsubst $(APP_OFFSET),$(APP2_OFFSET),$(ESPTOOL_ALL_FLASH_ARGS))
120120

121121
$(OTA1_BIN): all_binaries
122+
@cp $(RAW_BIN) $(RAW_BIN).old
122123
@cp $(RAW_BIN) $(OTA1_BIN)
123124
@echo [GEN] $(OTA1_BIN)
124125

125126
$(OTA2_BIN): $(OTA1_BIN)
126127
ifdef __COMBILE_OTA_BIN
127128
@rm -f ./build/esp8266/esp8266_out.ld
128-
@export CFLAGS= && export CXXFLAGS= && make APP_OFFSET=$(APP2_OFFSET) APP_SIZE=$(APP2_SIZE)
129+
@export CFLAGS= && export CXXFLAGS= && make $(APP_BIN) APP_OFFSET=$(APP2_OFFSET) APP_SIZE=$(APP2_SIZE)
129130
endif
130131
@cp $(RAW_BIN) $(OTA2_BIN)
131132
@echo [GEN] $(OTA2_BIN)
@@ -150,6 +151,8 @@ ifdef CONFIG_ESP8266_OTA_FROM_OLD
150151
ota: $(OTA_V2_TO_V3_BIN)
151152
else
152153
ota: $(OTA_BIN)
154+
@cp $(RAW_BIN).old $(RAW_BIN)
155+
@rm $(RAW_BIN).old
153156
endif
154157

155158
ota-clean:

0 commit comments

Comments
 (0)