From c13d09d7b47bd7131d71a3fd755c2c887e6d0f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 25 Jun 2025 13:57:41 +0200 Subject: [PATCH] soc: silabs: siwx91x: Call "west sign" automatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Aasim Shaik Signed-off-by: Jérôme Pouiller --- soc/silabs/silabs_siwx91x/CMakeLists.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/soc/silabs/silabs_siwx91x/CMakeLists.txt b/soc/silabs/silabs_siwx91x/CMakeLists.txt index 7997c79d4a9..8ec7c16aef2 100644 --- a/soc/silabs/silabs_siwx91x/CMakeLists.txt +++ b/soc/silabs/silabs_siwx91x/CMakeLists.txt @@ -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()