Skip to content

Commit

Permalink
Upload: Honor OUTPUT_EXT for flash
Browse files Browse the repository at this point in the history
In upload method flash, if OUTPUT_EXT is defined in targets.json5, use
image file with this extension <target>.<OUTPUT_EXT> for flash, or default
to <target>.bin.
  • Loading branch information
ccli8 committed Aug 23, 2024
1 parent 88de6a1 commit 33a6fc1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/cmake/UploadMethodManager.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ set(MBED_UPLOAD_RESTART_COMMANDS ${UPLOAD_RESTART_COMMANDS} CACHE INTERNAL "" FO

function(mbed_generate_upload_target target)
# add upload target
gen_upload_target(${target}
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.bin
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.hex
)
if ("${MBED_OUTPUT_EXT}" STREQUAL "" OR MBED_OUTPUT_EXT STREQUAL "bin")
gen_upload_target(${target} ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.bin)
else()
gen_upload_target(${target} ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_BASE_NAME:${target}>.hex)
endif()
endfunction()

0 comments on commit 33a6fc1

Please sign in to comment.