feat(esp8266): Add feature to copy old RF parameters to new SDK partition

The old SDK's RF parameters is also kept.
This commit is contained in:
dongheng
2019-04-03 14:11:11 +08:00
parent 2b579ef758
commit 37ffcbe9e6
7 changed files with 169 additions and 36 deletions

View File

@ -277,7 +277,7 @@ config INIT_OS_BEFORE_START
FreeRTOS need not do this.
config ESP8266_OTA_FROM_OLD
bool "(**Expected**)ESP8266 update from old SDK by OTA"
bool "ESP8266 update from old SDK by OTA"
default n
depends on IDF_TARGET_ESP8266
select ESP8266_BOOT_COPY_APP if ESPTOOLPY_FLASHSIZE_1MB
@ -289,8 +289,21 @@ config ESP8266_OTA_FROM_OLD
The old RTOS SDK(before V3.0) or NonOS SDK can download the firmware to its partition and run it as it self's application.
config LOAD_OLD_RF_PARAMETER
bool "Load old RF Parameters"
default n
depends on ESP8266_OTA_FROM_OLD
select ESP_PHY_INIT_DATA_IN_PARTITION
help
The function is not released.
Enable this option, after updating from old SDK to new SDK, bootloader will copy RF
parameters from old SDK partition to new SDK partition.
Then application can read the RF parameters from new partition directly.
config ESP8266_BOOT_COPY_APP
bool "(**Expected**)Boot copy app"
bool "Boot copy app"
default n
help
The function is not released.

View File

@ -40,9 +40,9 @@ ESPTOOL_ALL_FLASH_ARGS += $(PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
ESP8266_COMPONENT_PATH := $(COMPONENT_PATH)
$(PHY_INIT_DATA_OBJ): $(ESP8266_COMPONENT_PATH)/source/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
$(PHY_INIT_DATA_OBJ): $(ESP8266_COMPONENT_PATH)/include/internal/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
$(summary) CC $(notdir $@)
printf "#include \"source/phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP8266_COMPONENT_PATH) -I $(ESP8266_COMPONENT_PATH)/include -c -o $@ -xc -
printf "#include \"internal/phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP8266_COMPONENT_PATH) -I $(ESP8266_COMPONENT_PATH)/include -c -o $@ -xc -
$(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ)
$(summary) BIN $(notdir $@)
@ -120,7 +120,7 @@ endif
PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
ifdef CONFIG_ESP8266_OTA_FROM_OLD
$(OTA_V2_TO_V3_BIN): all_binaries
$(OTA_V2_TO_V3_BIN): all
@$(PYTHON) $(IDF_PATH)/tools/pack_fw.py --output $(OTA_V2_TO_V3_BIN) --app $(PROJECT_NAME).bin pack3 $(ESPTOOL_ALL_FLASH_ARGS)
@echo [GEN] $(OTA_V2_TO_V3_BIN)
endif

View File

@ -27,7 +27,7 @@
#include "nvs_flash.h"
#include "sdkconfig.h"
#include "phy_init_data.h"
#include "internal/phy_init_data.h"
#include "phy.h"
static const char *TAG = "phy_init";