mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-10-21 07:02:24 +08:00
feat(partition_table): Update partition table script and OTA example
1. APP binary supports 4KB align instead of 64KB align 2. Add options to sdkconfig.defaults: 2.1. using 1MB flash 2.2. use custom partition table "partitions_two_ota.1MB.mini.csv" 2.3. custom partition table base address is 0x4000 3. "make ota flash" using APP1_OFFSET as app downloading address
This commit is contained in:
@@ -27,13 +27,6 @@ config PARTITION_TABLE_CUSTOM_FILENAME
|
||||
Name of the custom partition CSV filename. This path is evaluated
|
||||
relative to the project root directory.
|
||||
|
||||
config PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET
|
||||
hex "Factory app partition offset" if PARTITION_TABLE_CUSTOM
|
||||
default 0x10000
|
||||
help
|
||||
If using a custom partition table, specify the offset in the flash
|
||||
where 'make flash' should write the built app.
|
||||
|
||||
config PARTITION_TABLE_OFFSET
|
||||
hex "Partition table offset address at flash"
|
||||
default 0x8000
|
||||
@@ -58,17 +51,56 @@ config PARTITION_TABLE_FILENAME
|
||||
default partitions_two_ota_coredump.csv if PARTITION_TABLE_TWO_OTA && ESP32_ENABLE_COREDUMP_TO_FLASH
|
||||
default PARTITION_TABLE_CUSTOM_FILENAME if PARTITION_TABLE_CUSTOM
|
||||
|
||||
config APP_OFFSET
|
||||
hex
|
||||
default PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET if PARTITION_TABLE_CUSTOM
|
||||
default 0x10000 # this is the factory app offset used by the default tables
|
||||
|
||||
config PHY_DATA_OFFSET
|
||||
depends on ESP_PHY_INIT_DATA_IN_PARTITION
|
||||
hex
|
||||
default PARTITION_TABLE_CUSTOM_PHY_DATA_OFFSET if PARTITION_TABLE_CUSTOM
|
||||
default 0xf000 # this is the factory app offset used by the default tables
|
||||
|
||||
config APP2_SUPPORT
|
||||
depends on ESPTOOLPY_FLASHSIZE_1MB && (PARTITION_TABLE_TWO_OTA || PARTITION_TABLE_CUSTOM)
|
||||
bool "Support to setup partition parameter of APP2" if PARTITION_TABLE_CUSTOM
|
||||
default y
|
||||
help
|
||||
Enable this option, if you want to have APP1 & APP2 in 1MB SPI Flash.
|
||||
|
||||
config APP1_OFFSET
|
||||
hex "APP1 partition offset" if PARTITION_TABLE_CUSTOM
|
||||
default 0x10000
|
||||
help
|
||||
If using a custom partition table, specify the offset in the flash
|
||||
where the APP1 located.
|
||||
|
||||
It should be same as the value in the custom partition table CSV.
|
||||
|
||||
config APP1_SIZE
|
||||
hex "APP1 partition size(by bytes)" if PARTITION_TABLE_CUSTOM
|
||||
default 0x70000 if APP2_SUPPORT
|
||||
default 0xF0000
|
||||
help
|
||||
APP1 partition size by bytes.
|
||||
|
||||
It should be same as the value in the custom partition table CSV.
|
||||
|
||||
config APP2_OFFSET
|
||||
depends on APP2_SUPPORT
|
||||
hex "APP2 partition offset" if PARTITION_TABLE_CUSTOM
|
||||
default 0x80000
|
||||
help
|
||||
If using a custom partition table, specify the offset in the flash
|
||||
where the APP2 located.
|
||||
|
||||
It should be same as the value in the custom partition table CSV.
|
||||
|
||||
config APP2_SIZE
|
||||
depends on APP2_SUPPORT
|
||||
hex "APP2 partition size(by bytes)" if PARTITION_TABLE_CUSTOM
|
||||
default 0x70000
|
||||
help
|
||||
APP2 partition size by bytes.
|
||||
|
||||
It should be same as the value in the custom partition table CSV.
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
|
@@ -45,6 +45,11 @@ $(PARTITION_TABLE_BIN_UNSIGNED): $(PARTITION_TABLE_CSV_PATH) $(SDKCONFIG_MAKEFIL
|
||||
|
||||
all_binaries: $(PARTITION_TABLE_BIN)
|
||||
|
||||
APP_OFFSET ?= $(CONFIG_APP1_OFFSET)
|
||||
APP_SIZE ?= $(CONFIG_APP1_SIZE)
|
||||
|
||||
export APP_OFFSET APP_SIZE
|
||||
|
||||
PARTITION_TABLE_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(PARTITION_TABLE_OFFSET) $(PARTITION_TABLE_BIN)
|
||||
ESPTOOL_ALL_FLASH_ARGS += $(PARTITION_TABLE_OFFSET) $(PARTITION_TABLE_BIN)
|
||||
|
||||
|
@@ -163,7 +163,7 @@ class PartitionDefinition(object):
|
||||
MAGIC_BYTES = b"\xAA\x50"
|
||||
|
||||
ALIGNMENT = {
|
||||
APP_TYPE : 0x10000,
|
||||
APP_TYPE : 0x1000,
|
||||
DATA_TYPE : 0x04,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user