Skip to content

Commit 00228f4

Browse files
committed
trusted-firmware-m: Create bin files to FOTA
One fundamental use of trusted-firmware-m is to allow IoT applications to have security and the firmware upgrade is almost 100% mandatory in these applications. The current state of files signing process do not produce the necessary binaries to use with FWU because the hex images are not suitable for this use case. This introduces the missing signed binaries files to be used by FWU partition. Signed-off-by: BUDKE Gerson Fernando <[email protected]>
1 parent 1f1a1ae commit 00228f4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ if (CONFIG_BUILD_WITH_TFM)
531531
set(S_NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_zephyr_ns_signed.hex)
532532
set(NS_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.hex)
533533
set(S_SIGNED_HEX_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.hex)
534+
set(NS_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/zephyr_ns_signed.bin)
535+
set(S_SIGNED_BIN_FILE ${CMAKE_BINARY_DIR}/zephyr/tfm_s_signed.bin)
534536

535537
if (CONFIG_TFM_USE_NS_APP)
536538
# Use the TF-M NS binary as the Non-Secure application firmware image
@@ -580,16 +582,21 @@ if (CONFIG_BUILD_WITH_TFM)
580582
else()
581583
if (CONFIG_TFM_USE_NS_APP)
582584
tfm_sign(sign_cmd_ns_hex NS TRUE TRUE TRUE ${NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_HEX_FILE})
585+
tfm_sign(sign_cmd_ns_bin NS TRUE TRUE FALSE ${NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_BIN_FILE})
583586
else()
584587
tfm_sign(sign_cmd_ns_hex NS FALSE TRUE TRUE ${NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_HEX_FILE})
588+
tfm_sign(sign_cmd_ns_bin NS FALSE TRUE FALSE ${NS_MAX_SECTORS} ${NS_APP_FILE} ${NS_SIGNED_BIN_FILE})
585589
endif()
586590

587591
tfm_sign(sign_cmd_s_hex S TRUE TRUE TRUE ${S_MAX_SECTORS} $<TARGET_PROPERTY:tfm,TFM_S_HEX_FILE> ${S_SIGNED_HEX_FILE})
592+
tfm_sign(sign_cmd_s_bin S TRUE TRUE FALSE ${S_MAX_SECTORS} $<TARGET_PROPERTY:tfm,TFM_S_BIN_FILE> ${S_SIGNED_BIN_FILE})
588593

589594
#Create and sign for concatenated binary image, should align with the TF-M BL2
590595
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
591596
COMMAND ${sign_cmd_ns_hex}
597+
COMMAND ${sign_cmd_ns_bin}
592598
COMMAND ${sign_cmd_s_hex}
599+
COMMAND ${sign_cmd_s_bin}
593600

594601
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py
595602
-o ${MERGED_HEX_FILE}
@@ -601,7 +608,9 @@ if (CONFIG_BUILD_WITH_TFM)
601608

602609
set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts
603610
${S_SIGNED_HEX_FILE}
611+
${S_SIGNED_BIN_FILE}
604612
${NS_SIGNED_HEX_FILE}
613+
${NS_SIGNED_BIN_FILE}
605614
${MERGED_HEX_FILE}
606615
)
607616
endif()

0 commit comments

Comments
 (0)