cmake app_update: Add "flash blank otadata" functionality to cmake
This commit is contained in:
parent
a6282e3e5e
commit
38c0626090
|
@ -1,7 +1,17 @@
|
|||
set(COMPONENT_SRCDIRS ".")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
||||
|
||||
set(COMPONENT_REQUIRES spi_flash)
|
||||
set(COMPONENT_REQUIRES spi_flash partition_table)
|
||||
set(COMPONENT_PRIV_REQUIRES bootloader_support)
|
||||
|
||||
register_component()
|
||||
|
||||
# Add custom target for generating empty otadata partition for flashing
|
||||
if(${OTADATA_PARTITION_OFFSET})
|
||||
add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/${BLANK_OTADATA_FILE}"
|
||||
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/gen_empty_partition.py
|
||||
--size ${OTADATA_PARTITION_SIZE} "${PROJECT_BINARY_DIR}/${BLANK_OTADATA_FILE}")
|
||||
|
||||
add_custom_target(blank_ota_data ALL DEPENDS "${PROJECT_BINARY_DIR}/${BLANK_OTADATA_FILE}")
|
||||
add_dependencies(flash blank_ota_data)
|
||||
endif()
|
||||
|
|
8
components/app_update/project_include.cmake
Normal file
8
components/app_update/project_include.cmake
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
# Set empty otadata partition file for flashing, if OTA data partition in
|
||||
# partition table
|
||||
# (NB: because of component dependency, we know partition_table
|
||||
# project_include.cmake has already been included.)
|
||||
if(${OTADATA_PARTITION_OFFSET})
|
||||
set(BLANK_OTADATA_FILE "ota_data_initial.bin")
|
||||
endif()
|
|
@ -3,5 +3,7 @@
|
|||
--flash_freq ${ESPFLASHFREQ}
|
||||
0x1000 bootloader/bootloader.bin
|
||||
${PARTITION_TABLE_OFFSET} partition_table/partition-table.bin
|
||||
${APP_PARTITION_OFFSET} ${PROJECT_NAME}.bin
|
||||
${PHY_PARTITION_OFFSET} ${PHY_PARTITION_BIN_FILE}
|
||||
${OTADATA_PARTITION_OFFSET} ${BLANK_OTADATA_FILE}
|
||||
${APP_PARTITION_OFFSET} ${PROJECT_NAME}.bin
|
||||
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
"flash_files" : {
|
||||
"0x1000" : "bootloader/bootloader.bin",
|
||||
"${PARTITION_TABLE_OFFSET}" : "partition_table/partition-table.bin",
|
||||
"${APP_PARTITION_OFFSET}" : "${PROJECT_NAME}.bin",
|
||||
"${PHY_PARTITION_OFFSET}" : "${PHY_PARTITION_BIN_FILE}"
|
||||
"${PHY_PARTITION_OFFSET}" : "${PHY_PARTITION_BIN_FILE}",
|
||||
"${OTADATA_PARTITION_OFFSET}" : "${BLANK_OTADATA_FILE}",
|
||||
"${APP_PARTITION_OFFSET}" : "${PROJECT_NAME}.bin"
|
||||
},
|
||||
"bootloader" : { "offset" : "0x1000",
|
||||
"file" : "bootloader/bootloader.bin" },
|
||||
"app" : { "offset" : "${APP_PARTITION_OFFSET}",
|
||||
"file" : "${PROJECT_NAME}.bin" },
|
||||
"partition_table" : { "offset" : "${PARTITION_TABLE_OFFSET}",
|
||||
"file" : "partition_table/partition-table.bin" }
|
||||
"file" : "partition_table/partition-table.bin" },
|
||||
"otadata" : { "offset" : "${OTADATA_PARTITION_OFFSET}",
|
||||
"file" : "${BLANK_OTADATA_FILE}" },
|
||||
"app" : { "offset" : "${APP_PARTITION.py_OFFSET}",
|
||||
"file" : "${PROJECT_NAME}.bin" }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue