Merge branch 'bugfix/fix_combine_binary_overwrite_check' into 'master'

Fix combine binary overwrite checking

See merge request sdk/ESP8266_RTOS_SDK!779
This commit is contained in:
Dong Heng
2019-03-01 14:13:07 +08:00
5 changed files with 56 additions and 9 deletions

View File

@ -217,7 +217,7 @@ config ESP8266_OTA_FROM_OLD
bool "(**Expected**)ESP8266 update from old SDK by OTA"
default n
depends on IDF_TARGET_ESP8266
select ESP8266_BOOT_COPY_APP
select ESP8266_BOOT_COPY_APP if ESPTOOLPY_FLASHSIZE_1MB
help
The function is not released.

View File

@ -134,7 +134,7 @@ ifdef CONFIG_ESP8266_OTA_FROM_OLD
$(OTA_V2_TO_V3_BIN): $(OTA_BIN)
@cp $(RAW_BIN) $(RAW_BIN).tmp.bak
@cp $(OTA1_BIN) $(RAW_BIN)
@python $(IDF_PATH)/tools/pack_fw.py --output $(OTA_V2_TO_V3_BIN) pack3 $(ESPTOOL_ALL_FLASH_ARGS)
@python $(IDF_PATH)/tools/pack_fw.py --output $(OTA_V2_TO_V3_BIN) --app $(PROJECT_NAME).bin pack3 $(ESPTOOL_ALL_FLASH_ARGS)
@cp $(RAW_BIN).tmp.bak $(RAW_BIN)
@echo [GEN] $(OTA_V2_TO_V3_BIN)
endif

View File

@ -434,7 +434,8 @@ int esp_patition_table_init_data(void *partition_info)
{
int ret;
const uint32_t boot_base = 0x1000;
const uint32_t boot_size = s_v2_flash_bin_size / 2 - boot_base - 4 * SPI_FLASH_SEC_SIZE;
const bootloader_state_t *bs = (const bootloader_state_t *)partition_info;
const uint32_t boot_size = bs->ota[0].offset + bs->ota[0].size - boot_base;
if (!esp_sdk_update_from_v2())
return 0;