soc: silabs: siwx91x: Call "west sign" automatically

Once the keys has been provisioned on the Silabs siwx91x, the chip expects
the firmware to be properly signed.

This PR automate the signing process. Hence, "west flash" will work as
expected.

Co-developed-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
This commit is contained in:
Jérôme Pouiller 2025-06-25 13:57:41 +02:00 committed by Daniel DeGrasse
parent 00b3c53704
commit c13d09d7b4

View File

@ -1,5 +1,6 @@
# Copyright (c) 2024 Silicon Laboratories Inc.
# Copyright (c) 2024-2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0
include(west)
add_subdirectory(siwg917)
@ -12,5 +13,18 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
${KERNEL_BIN_NAME}
${KERNEL_BIN_NAME}.rps
)
# runners_yaml_props_target controls the file used by "west flash"
set_target_properties(runners_yaml_props_target PROPERTIES bin_file ${PROJECT_BINARY_DIR}/${KERNEL_BIN_NAME}.rps)
if(CONFIG_SIWX91X_SIGN_KEY OR CONFIG_SIWX91X_MIC_KEY)
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE}
${WEST} sign -t silabs_commander --build-dir ${CMAKE_BINARY_DIR}
)
set_target_properties(runners_yaml_props_target
PROPERTIES bin_file ${PROJECT_BINARY_DIR}/${KERNEL_NAME}.signed.bin.rps
)
else()
set_target_properties(runners_yaml_props_target
PROPERTIES bin_file ${PROJECT_BINARY_DIR}/${KERNEL_BIN_NAME}.rps
)
endif()