project_include.cmake 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. # Set some global esptool.py variables
  2. #
  3. # Many of these are read when generating flash_app_args & flash_project_args
  4. idf_build_get_property(target IDF_TARGET)
  5. idf_build_get_property(python PYTHON)
  6. set(chip_model ${target})
  7. if(target STREQUAL "esp32s3")
  8. if(CONFIG_IDF_TARGET_ESP32S3_BETA_VERSION_2)
  9. set(chip_model "esp32s3beta2")
  10. endif()
  11. endif()
  12. set(ESPTOOLPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/esptool.py" --chip ${chip_model})
  13. set(ESPSECUREPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/espsecure.py")
  14. set(ESPEFUSEPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/espefuse.py")
  15. set(ESPFLASHMODE ${CONFIG_ESPTOOLPY_FLASHMODE})
  16. set(ESPFLASHFREQ ${CONFIG_ESPTOOLPY_FLASHFREQ})
  17. set(ESPFLASHSIZE ${CONFIG_ESPTOOLPY_FLASHSIZE})
  18. set(ESPTOOLPY_FLASH_OPTIONS
  19. --flash_mode ${ESPFLASHMODE}
  20. --flash_freq ${ESPFLASHFREQ}
  21. --flash_size ${ESPFLASHSIZE}
  22. )
  23. if(NOT BOOTLOADER_BUILD)
  24. set(esptool_elf2image_args --elf-sha256-offset 0xb0)
  25. endif()
  26. if(NOT CONFIG_SECURE_BOOT_ALLOW_SHORT_APP_PARTITION AND
  27. NOT BOOTLOADER_BUILD)
  28. if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
  29. list(APPEND esptool_elf2image_args --secure-pad)
  30. elseif(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME)
  31. list(APPEND esptool_elf2image_args --secure-pad-v2)
  32. endif()
  33. endif()
  34. if(CONFIG_ESP32_REV_MIN)
  35. list(APPEND esptool_elf2image_args --min-rev ${CONFIG_ESP32_REV_MIN})
  36. endif()
  37. if(CONFIG_ESPTOOLPY_FLASHSIZE_DETECT)
  38. # Set ESPFLASHSIZE to 'detect' *after* elf2image options are generated,
  39. # as elf2image can't have 'detect' as an option...
  40. set(ESPFLASHSIZE detect)
  41. endif()
  42. if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME)
  43. set(ESPFLASHSIZE keep)
  44. endif()
  45. idf_build_get_property(build_dir BUILD_DIR)
  46. idf_build_get_property(elf_name EXECUTABLE_NAME GENERATOR_EXPRESSION)
  47. idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION)
  48. idf_build_get_property(elf_dir EXECUTABLE_DIR GENERATOR_EXPRESSION)
  49. if(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES AND NOT BOOTLOADER_BUILD)
  50. set(unsigned_project_binary "${elf_name}-unsigned.bin")
  51. else()
  52. set(unsigned_project_binary "${elf_name}.bin")
  53. endif()
  54. set(PROJECT_BIN "${elf_name}.bin")
  55. #
  56. # Add 'app.bin' target - generates with elf2image
  57. #
  58. if(CONFIG_APP_BUILD_GENERATE_BINARIES)
  59. add_custom_command(OUTPUT "${build_dir}/.bin_timestamp"
  60. COMMAND ${ESPTOOLPY} elf2image ${ESPTOOLPY_FLASH_OPTIONS} ${esptool_elf2image_args}
  61. -o "${build_dir}/${unsigned_project_binary}" "${elf_dir}/${elf}"
  62. COMMAND ${CMAKE_COMMAND} -E echo "Generated ${build_dir}/${unsigned_project_binary}"
  63. COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${unsigned_project_binary}" > "${build_dir}/.bin_timestamp"
  64. DEPENDS ${elf}
  65. VERBATIM
  66. WORKING_DIRECTORY ${build_dir}
  67. COMMENT "Generating binary image from built executable"
  68. )
  69. add_custom_target(gen_project_binary DEPENDS "${build_dir}/.bin_timestamp")
  70. endif()
  71. set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
  72. APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
  73. "${build_dir}/${unsigned_project_binary}"
  74. )
  75. if(CONFIG_APP_BUILD_GENERATE_BINARIES)
  76. add_custom_target(app ALL DEPENDS gen_project_binary)
  77. endif()
  78. if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
  79. set(secure_boot_version "1")
  80. elseif(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME)
  81. set(secure_boot_version "2")
  82. endif()
  83. if(NOT BOOTLOADER_BUILD AND CONFIG_SECURE_SIGNED_APPS)
  84. if(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)
  85. # for locally signed secure boot image, add a signing step to get from unsigned app to signed app
  86. add_custom_command(OUTPUT "${build_dir}/.signed_bin_timestamp"
  87. COMMAND ${ESPSECUREPY} sign_data --version ${secure_boot_version} --keyfile ${secure_boot_signing_key}
  88. -o "${build_dir}/${PROJECT_BIN}" "${build_dir}/${unsigned_project_binary}"
  89. COMMAND ${CMAKE_COMMAND} -E echo "Generated signed binary image ${build_dir}/${PROJECT_BIN}"
  90. "from ${build_dir}/${unsigned_project_binary}"
  91. COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${PROJECT_BIN}" > "${build_dir}/.signed_bin_timestamp"
  92. DEPENDS "${build_dir}/.bin_timestamp"
  93. VERBATIM
  94. COMMENT "Generating signed binary image"
  95. )
  96. add_custom_target(gen_signed_project_binary DEPENDS "${build_dir}/.signed_bin_timestamp")
  97. add_dependencies(gen_project_binary gen_signed_project_binary)
  98. set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
  99. APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
  100. "${build_dir}/${PROJECT_BIN}"
  101. )
  102. else()
  103. string(REPLACE ";" " " espsecurepy "${ESPSECUREPY}")
  104. add_custom_command(TARGET app POST_BUILD
  105. COMMAND ${CMAKE_COMMAND} -E echo
  106. "App built but not signed. Sign app before flashing"
  107. COMMAND ${CMAKE_COMMAND} -E echo
  108. "\t${espsecurepy} sign_data --keyfile KEYFILE --version ${secure_boot_version} \
  109. ${build_dir}/${PROJECT_BIN}"
  110. VERBATIM)
  111. endif()
  112. endif()
  113. add_custom_target(erase_flash
  114. COMMAND ${CMAKE_COMMAND}
  115. -D IDF_PATH="${idf_path}"
  116. -D ESPTOOLPY="${ESPTOOLPY}"
  117. -D ESPTOOL_ARGS="erase_flash"
  118. -P run_esptool.cmake
  119. WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  120. USES_TERMINAL
  121. )
  122. add_custom_target(monitor
  123. COMMAND ${CMAKE_COMMAND}
  124. -D IDF_PATH="${idf_path}"
  125. -D IDF_MONITOR="${idf_path}/tools/idf_monitor.py"
  126. -D ELF_FILE="${elf_dir}/${elf}"
  127. -D WORKING_DIRECTORY="${build_dir}"
  128. -P run_idf_monitor.cmake
  129. WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  130. USES_TERMINAL
  131. )
  132. set(esptool_flash_main_args "--before=${CONFIG_ESPTOOLPY_BEFORE}")
  133. if(CONFIG_SECURE_BOOT OR CONFIG_SECURE_FLASH_ENC_ENABLED)
  134. # If security enabled then override post flash option
  135. list(APPEND esptool_flash_main_args "--after=no_reset")
  136. else()
  137. list(APPEND esptool_flash_main_args "--after=${CONFIG_ESPTOOLPY_AFTER}")
  138. endif()
  139. if(CONFIG_ESPTOOLPY_NO_STUB)
  140. list(APPEND esptool_flash_main_args "--no-stub")
  141. endif()
  142. idf_component_set_property(esptool_py FLASH_ARGS "${esptool_flash_main_args}")
  143. idf_component_set_property(esptool_py FLASH_SUB_ARGS "${ESPTOOLPY_FLASH_OPTIONS}")
  144. function(esptool_py_partition_needs_encryption retencrypted partition_name)
  145. # Check if encryption is enabled
  146. if(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
  147. # Encryption is enabled, get partition type, subtype and encrypted flag to
  148. # determine whether it needs encryption or not.
  149. partition_table_get_partition_info(type "--partition-name ${partition_name}" "type")
  150. partition_table_get_partition_info(subtype "--partition-name ${partition_name}" "subtype")
  151. partition_table_get_partition_info(encrypted "--partition-name ${partition_name}" "encrypted")
  152. # As defined in gen_esp32part.py file:
  153. # Types:
  154. # - APP 0x00
  155. # - DATA 0x01
  156. # Subtypes:
  157. # - ota 0x00
  158. # - nvs 0x02
  159. # If the partition is an app, an OTA or an NVS partition, then it should be
  160. # encrypted
  161. if(
  162. (${type} EQUAL 0) OR
  163. (${type} EQUAL 1 AND ${subtype} EQUAL 0) OR
  164. (${type} EQUAL 1 AND ${subtype} EQUAL 2)
  165. )
  166. set(encrypted TRUE)
  167. endif()
  168. # Return 'encrypted' value to the caller
  169. set(${retencrypted} ${encrypted} PARENT_SCOPE)
  170. else()
  171. # Encryption not enabled, return false
  172. set(${retencrypted} FALSE PARENT_SCOPE)
  173. endif()
  174. endfunction()
  175. function(esptool_py_flash_to_partition target_name partition_name binary_path)
  176. # Retrieve the offset for the partition to flash the image on
  177. partition_table_get_partition_info(offset "--partition-name ${partition_name}" "offset")
  178. if(NOT offset)
  179. message(FATAL_ERROR "Could not find offset of partition ${partition_name}")
  180. endif()
  181. # Check whether the partition needs encryption or not
  182. esptool_py_partition_needs_encryption(encrypted ${partition_name})
  183. # The image name is also the partition name
  184. esptool_py_flash_target_image(${target_name} ${partition_name} ${offset}
  185. ${binary_path} ${encrypted})
  186. endfunction()
  187. # This function takes a fifth optional parameter: "encrypted". As its name
  188. # states, it marks whether the image should be flashed as encrypted or not.
  189. # If this parameter is provided, it should either be set to TRUE or FALSE,
  190. # if it is not provided, its value will be set to TRUE if build macro
  191. # CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT is set, FALSE else
  192. function(esptool_py_flash_target_image target_name image_name offset image)
  193. idf_build_get_property(build_dir BUILD_DIR)
  194. file(RELATIVE_PATH image ${build_dir} ${image})
  195. # Check if 'encrypted' parameter is provided
  196. if(${ARGC} GREATER 4)
  197. set(encrypted ${ARGV4})
  198. # If not, flash encryption mode marks whether the image should be encrypted
  199. elseif(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
  200. set(encrypted TRUE)
  201. else()
  202. set(encrypted FALSE)
  203. endif()
  204. # 'encrypted' is an uppercase boolean: TRUE or FALSE.
  205. # In order to keep consistent with other entries in
  206. # FLASH_ENTRY property, convert them to 'true' and
  207. # 'false' respectively.
  208. string(TOLOWER ${encrypted} lowerencrypted)
  209. # In the following snippet of code, some properties are defined for our
  210. # current target. These properties will be used to generate the actual
  211. # target_name_args files using the target_name_args.in files.
  212. # Please see function esptool_py_flash_target above for more information
  213. # about these properties and how they are used.
  214. # Add the image file, with its offset, to the list of files to
  215. # flash to the target. No matter whether flash encryption is
  216. # enabled or not, plain binaries (non-encrypted) need to be
  217. # generated
  218. set_property(TARGET ${target_name} APPEND PROPERTY FLASH_FILE
  219. "\"${offset}\" : \"${image}\"")
  220. set_property(TARGET ${target_name} APPEND PROPERTY FLASH_ENTRY
  221. "\"${image_name}\" : { \"offset\" : \"${offset}\", \"file\" : \"${image}\",\
  222. \"encrypted\" : \"${lowerencrypted}\" }")
  223. set_property(TARGET ${target_name} APPEND PROPERTY IMAGES "${offset} ${image}")
  224. if(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
  225. # When flash encryption mode is enabled, if the current binary needs to
  226. # be encrypted, do the same as previously but prefixing target names with
  227. # "encrypted-".
  228. if(${encrypted})
  229. set_property(TARGET encrypted-${target_name} APPEND PROPERTY FLASH_FILE
  230. "\"${offset}\" : \"${image}\"")
  231. set_property(TARGET encrypted-${target_name} APPEND PROPERTY FLASH_ENTRY
  232. "\"${image_name}\" : { \"offset\" : \"${offset}\", \"file\" : \"${image}\" , \
  233. \"encrypted\" : \"${lowerencrypted}\" }")
  234. set_property(TARGET encrypted-${target_name} APPEND PROPERTY ENCRYPTED_IMAGES "${offset} ${image}")
  235. else()
  236. # The target doesn't need to be encrypted, thus, add the current file
  237. # to the NON_ENCRYPTED_IMAGES property
  238. set_property(TARGET encrypted-${target_name} APPEND PROPERTY NON_ENCRYPTED_IMAGES "${offset} ${image}")
  239. endif()
  240. endif()
  241. endfunction()
  242. # Use this function to generate a ternary expression that will be evaluated.
  243. # - retexpr is the expression returned by the function
  244. # - condition is the expression evaluated to a boolean
  245. # - condtrue is the expression to evaluate if condition is true
  246. # - condfalse is the expression to evaluate if condition is false
  247. # This function can be summarized as:
  248. # retexpr = condition ? condtrue : condfalse
  249. function(if_expr_generator retexpr condition condtrue condfalse)
  250. # CMake version 3.8 and above provide a ternary operator for expression
  251. # generator. For version under, we must simulate this behaviour
  252. if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
  253. # If condtrue is not empty, then we have to do something in case the
  254. # condition is true. Generate the expression that will be used in that
  255. # case
  256. if(condtrue)
  257. set(iftrue "$<${condition}:${condtrue}>")
  258. endif()
  259. # Same for condfalse. If it is empty, it is useless to create an expression
  260. # that will be evaluated later
  261. if(condfalse)
  262. set(iffalse "$<$<NOT:${condition}>:${condfalse}>")
  263. endif()
  264. # Concatenate the previously generated expressions. If one of them was not
  265. # initialized (because of empty condtrue/condfalse) it will be replace by
  266. # an empty string
  267. set(${retexpr} "${iftrue}${iffalse}" PARENT_SCOPE)
  268. else()
  269. # CMake 3.8 and above implement what we want, making the expression simpler
  270. set(${retexpr} "$<IF:${condition},${condtrue},${condfalse}>" PARENT_SCOPE)
  271. endif()
  272. endfunction()
  273. function(esptool_py_flash_target target_name main_args sub_args)
  274. set(single_value OFFSET IMAGE) # template file to use to be able to
  275. # flash the image individually using esptool
  276. cmake_parse_arguments(_ "" "${single_value}" "" "${ARGN}")
  277. idf_build_get_property(idf_path IDF_PATH)
  278. idf_build_get_property(build_dir BUILD_DIR)
  279. idf_component_get_property(esptool_py_dir esptool_py COMPONENT_DIR)
  280. add_custom_target(${target_name}
  281. COMMAND ${CMAKE_COMMAND}
  282. -D IDF_PATH="${idf_path}"
  283. -D ESPTOOLPY="${ESPTOOLPY}"
  284. -D ESPTOOL_ARGS="${main_args};write_flash;@${target_name}_args"
  285. -D WORKING_DIRECTORY="${build_dir}"
  286. -P ${esptool_py_dir}/run_esptool.cmake
  287. WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  288. USES_TERMINAL
  289. )
  290. set_target_properties(${target_name} PROPERTIES SUB_ARGS "${sub_args}")
  291. # Create the expression that contains the list of file names to pass
  292. # to esptool script
  293. set(flash_args_content "$<JOIN:$<TARGET_PROPERTY:${target_name},SUB_ARGS>, >\n\
  294. $<JOIN:$<TARGET_PROPERTY:${target_name},IMAGES>,\n>")
  295. # Write the previous expression to the target_name_args.in file
  296. file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_args.in"
  297. CONTENT "${flash_args_content}")
  298. # Generate the actual expression value from the content of the file
  299. # we just wrote
  300. file(GENERATE OUTPUT "${build_dir}/${target_name}_args"
  301. INPUT "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_args.in")
  302. # Check if 'encrypted' parameter is provided
  303. if(${ARGC} GREATER 3)
  304. set(encrypted ${ARGV3})
  305. # If not, flash encryption mode marks whether the image should be encrypted
  306. elseif(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
  307. set(encrypted TRUE)
  308. else()
  309. set(encrypted FALSE)
  310. endif()
  311. # If the file needs to be encrypted, create a target file that lets the user
  312. # flash this partition independently from other files.
  313. # For example, if 'target_name' is app-flash and 'encrypted' is TRUE,
  314. # 'build' directory will contain a file name 'encrypted_app-flash_args'
  315. if(${encrypted})
  316. add_custom_target(encrypted-${target_name}
  317. COMMAND ${CMAKE_COMMAND}
  318. -D IDF_PATH="${idf_path}"
  319. -D ESPTOOLPY="${ESPTOOLPY}"
  320. -D ESPTOOL_ARGS="${main_args};write_flash;@encrypted_${target_name}_args"
  321. -D WORKING_DIRECTORY="${build_dir}"
  322. -P ${esptool_py_dir}/run_esptool.cmake
  323. WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  324. USES_TERMINAL
  325. )
  326. # Generate the parameters for esptool.py command
  327. # In case we have both non encrypted and encrypted files to flash, we
  328. # can use --encrypt-files parameter to specify which ones should be
  329. # encrypted.
  330. # If we only have encrypted images to flash, we must use legacy
  331. # --encrypt parameter.
  332. # As the properties ENCRYPTED_IMAGES and NON_ENCRYPTED_IMAGES have not
  333. # been geenrated yet, we must use CMake expression generator to test
  334. # which esptool.py options we can use.
  335. # The variable has_non_encrypted_image will be evaluated to "1" if some
  336. # images must not be encrypted. This variable will be used in the next
  337. # expression
  338. set(has_non_encrypted_images "$<BOOL:$<TARGET_PROPERTY:\
  339. encrypted-${target_name},NON_ENCRYPTED_IMAGES>>")
  340. # Prepare esptool arguments (--encrypt or --encrypt-files)
  341. if_expr_generator(if_non_enc_expr ${has_non_encrypted_images}
  342. "" "--encrypt")
  343. set_target_properties(encrypted-${target_name} PROPERTIES SUB_ARGS
  344. "${sub_args}; ${if_non_enc_expr}")
  345. # Generate the list of files to pass to esptool
  346. set(encrypted_files "$<JOIN:$<TARGET_PROPERTY\
  347. :encrypted-${target_name},ENCRYPTED_IMAGES>,\n>")
  348. set(non_encrypted_files "$<JOIN:$<TARGET_PROPERTY:\
  349. encrypted-${target_name},NON_ENCRYPTED_IMAGES>,\n>")
  350. # Put both lists together, use --encrypted-files if we do also have
  351. # plain images to flash
  352. if_expr_generator(if_enc_expr ${has_non_encrypted_images}
  353. "--encrypt-files\n" "")
  354. set(flash_args_content "$<JOIN:$<TARGET_PROPERTY:\
  355. encrypted-${target_name},SUB_ARGS>, >\
  356. ${non_encrypted_files}\n\
  357. ${if_enc_expr}\
  358. ${encrypted_files}")
  359. # The expression is ready to be geenrated, write it to the file which
  360. # extension is .in
  361. file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/encrypted_${target_name}_args.in"
  362. CONTENT "${flash_args_content}")
  363. # Generate the actual string from the content of the file we just wrote
  364. file(GENERATE OUTPUT "${build_dir}/encrypted_${target_name}_args"
  365. INPUT "${CMAKE_CURRENT_BINARY_DIR}/encrypted_${target_name}_args.in")
  366. else()
  367. fail_target(encrypted-${target_name} "Error: The target encrypted-${target_name} requires"
  368. "CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT to be enabled.")
  369. endif()
  370. endfunction()
  371. function(esptool_py_custom_target target_name flasher_filename dependencies)
  372. idf_component_get_property(main_args esptool_py FLASH_ARGS)
  373. idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS)
  374. idf_build_get_property(build_dir BUILD_DIR)
  375. esptool_py_flash_target(${target_name} "${main_args}" "${sub_args}")
  376. # Copy the file to flash_xxx_args for compatibility for select target
  377. file_generate("${build_dir}/flash_${flasher_filename}_args"
  378. INPUT "${build_dir}/${target_name}_args")
  379. add_dependencies(${target_name} ${dependencies})
  380. if(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
  381. file_generate("${build_dir}/flash_encrypted_${flasher_filename}_args"
  382. INPUT "${build_dir}/encrypted_${target_name}_args")
  383. add_dependencies(encrypted-${target_name} ${dependencies})
  384. endif()
  385. endfunction()
  386. if(NOT BOOTLOADER_BUILD)
  387. set(flash_deps "partition_table_bin")
  388. if(CONFIG_APP_BUILD_GENERATE_BINARIES)
  389. list(APPEND flash_deps "app")
  390. endif()
  391. if(CONFIG_APP_BUILD_BOOTLOADER)
  392. list(APPEND flash_deps "bootloader")
  393. endif()
  394. esptool_py_custom_target(flash project "${flash_deps}")
  395. endif()