Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,24 +618,21 @@ if(CONFIG_BUILD_WITH_TFM)
$<$<BOOL:${CONFIG_TFM_BL1}>:$<TARGET_PROPERTY:tfm,BL2_SIGNED_HEX_FILE>>
$<$<NOT:$<BOOL:${CONFIG_TFM_BL1}>>:$<TARGET_PROPERTY:tfm,BL2_HEX_FILE>>
${S_NS_SIGNED_CONFIRMED_HEX_FILE}

COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${MERGED_HEX_FILE} ${MERGED_BIN_FILE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that because mergehex already works on the hex files in order to produce the bin binary, then there is no reason for going through an extra mergehex path.

The question regarding bin output depending on hex output, and thus mergehex producing bin output is another (though important) discussion, is something which I don't think belong here.

Thus approving this change.

)

set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${sign_cmd_s_ns_hex}

COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py
-o ${MERGED_BIN_FILE} --output-bin
$<$<BOOL:${CONFIG_TFM_BL1}>:$<TARGET_PROPERTY:tfm,BL2_SIGNED_HEX_FILE>>
$<$<NOT:$<BOOL:${CONFIG_TFM_BL1}>>:$<TARGET_PROPERTY:tfm,BL2_HEX_FILE>>
${S_NS_SIGNED_HEX_FILE}

COMMAND ${CMAKE_OBJCOPY} --input-target=ihex --output-target=binary ${S_NS_SIGNED_HEX_FILE} ${S_NS_SIGNED_BIN_FILE}
)

set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts
${S_NS_SIGNED_CONFIRMED_HEX_FILE}
${S_NS_HEX_FILE}
${S_NS_SIGNED_HEX_FILE}
${S_NS_SIGNED_BIN_FILE}
${MERGED_HEX_FILE}
${MERGED_BIN_FILE}
)
Expand Down