CMakeLists.txt 813 B

123456789101112131415161718192021
  1. idf_component_register(PRIV_REQUIRES partition_table)
  2. # Do not generate flash file when building bootloader or is in early expansion of the build
  3. if(BOOTLOADER_BUILD OR NOT CONFIG_APP_BUILD_BOOTLOADER)
  4. return()
  5. endif()
  6. add_dependencies(bootloader partition_table_bin)
  7. # When secure boot is enabled, do not flash bootloader along with invocation of `idf.py flash`
  8. if(NOT CONFIG_SECURE_BOOT)
  9. set(flash_bootloader FLASH_IN_PROJECT)
  10. endif()
  11. esptool_py_custom_target(bootloader-flash bootloader "bootloader")
  12. esptool_py_flash_target_image(bootloader-flash bootloader "0x1000" "${BOOTLOADER_BUILD_DIR}/bootloader.bin")
  13. # Also attach an image to the project flash target
  14. if(NOT CONFIG_SECURE_BOOT)
  15. esptool_py_flash_target_image(flash bootloader "0x1000" "${BOOTLOADER_BUILD_DIR}/bootloader.bin")
  16. endif()