From cfa8ed15c02adb5feaae3e4a52ed5f09f4dbd738 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 29 May 2018 14:46:45 +1000 Subject: [PATCH] partition table: Set partition table offset via variable --- components/esptool_py/flasher_args.json.in | 4 ++-- components/partition_table/CMakeLists.txt | 4 +--- components/partition_table/project_include.cmake | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 components/partition_table/project_include.cmake diff --git a/components/esptool_py/flasher_args.json.in b/components/esptool_py/flasher_args.json.in index 55e3a93a5b..1d68a2bb99 100644 --- a/components/esptool_py/flasher_args.json.in +++ b/components/esptool_py/flasher_args.json.in @@ -4,7 +4,7 @@ "--flash_freq", "${ESPFLASHFREQ}" ], "flash_files" : { "0x1000" : "bootloader/bootloader.bin", - "0x8000" : "partition_table/partition-table.bin", + "${PARTITION_TABLE_OFFSET}" : "partition_table/partition-table.bin", "${CONFIG_APP_OFFSET}" : "${PROJECT_NAME}.bin", "${PHY_PARTITION_OFFSET}" : "${PHY_PARTITION_BIN_FILE}" }, @@ -12,6 +12,6 @@ "file" : "bootloader/bootloader.bin" }, "app" : { "offset" : "${CONFIG_APP_OFFSET}", "file" : "${PROJECT_NAME}.bin" }, - "partition_table" : { "offset" : "0x8000", + "partition_table" : { "offset" : "${PARTITION_TABLE_OFFSET}", "file" : "partition_table/partition-table.bin" } } diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 72ef78ff10..eae14ceb2f 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -1,5 +1,3 @@ -set(partition_table_offset 0x8000) - register_config_only_component() # Set partition_csv to the configured partition source file @@ -56,5 +54,5 @@ add_custom_target(partition_table ALL DEPENDS "${final_partition_bin}") # the list of esptool write arguments for flashing set_property(GLOBAL APPEND_STRING PROPERTY ESPTOOL_WRITE_FLASH_ARGS - "${partition_table_offset} ${final_partition_bin} ") + "${PARTITION_TABLE_OFFSET} ${final_partition_bin} ") diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake new file mode 100644 index 0000000000..1658df30e8 --- /dev/null +++ b/components/partition_table/project_include.cmake @@ -0,0 +1 @@ +set(PARTITION_TABLE_OFFSET 0x8000) -- 2.40.0