2019-05-10 03:25:25 -04:00
|
|
|
idf_component_register(PRIV_REQUIRES partition_table)
|
2019-05-09 22:53:08 -04:00
|
|
|
|
2019-01-21 22:45:45 -05:00
|
|
|
# Do not generate flash file when building bootloader or is in early expansion of the build
|
2019-07-22 10:04:03 -04:00
|
|
|
if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER)
|
2019-01-21 22:45:45 -05:00
|
|
|
return()
|
|
|
|
endif()
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2019-05-10 03:25:25 -04:00
|
|
|
# When secure boot is enabled, do not flash bootloader along with invocation of `idf.py flash`
|
2020-02-24 14:51:41 -05:00
|
|
|
if(NOT CONFIG_SECURE_BOOT)
|
2019-05-10 03:25:25 -04:00
|
|
|
set(flash_bootloader FLASH_IN_PROJECT)
|
|
|
|
endif()
|
|
|
|
|
2019-01-21 22:45:45 -05:00
|
|
|
# Set values used in flash_bootloader_args.in and generate flash file
|
|
|
|
# for bootloader
|
2019-06-21 07:48:41 -04:00
|
|
|
esptool_py_flash_project_args(bootloader 0x1000
|
2019-01-21 22:45:45 -05:00
|
|
|
${BOOTLOADER_BUILD_DIR}/bootloader.bin
|
2019-05-10 03:25:25 -04:00
|
|
|
${flash_bootloader}
|
2019-06-14 00:53:46 -04:00
|
|
|
FLASH_FILE_TEMPLATE flash_bootloader_args.in)
|
|
|
|
|
|
|
|
esptool_py_custom_target(bootloader-flash bootloader "bootloader")
|
|
|
|
add_dependencies(bootloader partition_table)
|