Skip to content

Add support for west sign for Silabs SoCs #92181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jerome-pouiller
Copy link
Collaborator

@jerome-pouiller jerome-pouiller commented Jun 25, 2025

Silabs siwx91x support various security options. This PR exposes these options in west sign.

This PR is a rework of #87669 opened by @Aasimshaik11.

@pdgendt
Copy link
Collaborator

pdgendt commented Jun 25, 2025

Re-assigned to Silabs Platforms maintainers.

Comment on lines 63 to 64
silabs_commander
***************
Copy link
Member

Choose a reason for hiding this comment

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

minor: one more * seems to be needed to be the same length as the subtitle

jhedberg
jhedberg previously approved these changes Jun 25, 2025
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

@jerome-pouiller
Copy link
Collaborator Author

I'm surprised @Aasimshaik11 is not credited as an author, not even in the commit messages...

Definitely. Fixed.

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

The ${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE} change needs at the very least a separate commit and explanation in the commit message; preferably a separate PR.

A few other, non-blocking requests.

set_target_properties(runners_yaml_props_target
PROPERTIES bin_file ${PROJECT_BINARY_DIR}/${KERNEL_NAME}.signed.bin.rps
)
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use else() instead of overwriting, much clearer IMHO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✔️

@@ -196,7 +196,7 @@ foreach(target flash debug debugserver attach rtt)
-DDEPENDENCIES="$<TARGET_PROPERTY:${target},MANUALLY_ADDED_DEPENDENCIES>"
-P ${CMAKE_CURRENT_LIST_DIR}/check_runner_dependencies.cmake
COMMAND
${CMAKE_COMMAND} -E env
${CMAKE_COMMAND} -E env ZEPHYR_BASE=${ZEPHYR_BASE}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Errr... I really don't think a functional change like that should be hidden in a documentation commit.

While you may require this for some reason (a commit message would be useful), this code change is 100% generic and totally unrelated to Silab or even west sign. Please submit this in a separate PR, get it merged and then wait 1-2 days for nightly test runs to demonstrate it does not break anything or anyone's CI.

Copy link
Collaborator Author

@jerome-pouiller jerome-pouiller Jun 25, 2025

Choose a reason for hiding this comment

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

This change was not expected (I expect to create another PR for this one). I did a mistake when I did my first rebase.

in_file = f'{kernel_prefix}.bin.rps'
out_file = command.args.sbin or f'{kernel_prefix}.signed.bin.rps'
in_file = f'{kernel_prefix}.rps'
out_file = command.args.sbin or f'{kernel_prefix}.signed.rps'
Copy link
Collaborator

Choose a reason for hiding this comment

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

.bin: indeed the most overrated name providing the least information ever...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✔️

Copy link
Collaborator

Choose a reason for hiding this comment

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

)
set_target_properties(runners_yaml_props_target
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name runners_yaml_props_target is quite cryptic, does not seem related to flashing at all. So can you add a one-line comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✔️

Use runners_yaml_props_target to set the name of the file to
flash, rather than hard-coding it for each board.

Co-developed-by: Aksel Skauge Mellbye <[email protected]>
Signed-off-by: Aksel Skauge Mellbye <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
Disable generation of .hex output, since the Commander runner
prefers it over the .bin output but SiWx91x needs a .bin.rps file.

Signed-off-by: Aksel Skauge Mellbye <[email protected]>
Co-developed-by: Aksel Skauge Mellbye <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
Silabs siwx91x support signed and encrypted firmwares. This PR includes
support for these features in "west sign"

Co-developed-by: Aasim Shaik <[email protected]>
Signed-off-by: Aasim Shaik <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
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 <[email protected]>
Signed-off-by: Aasim Shaik <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
Add the relevant documentation for the silabs_commander runner.

Co-developed-by: Aasim Shaik <[email protected]>
Signed-off-by: Aasim Shaik <[email protected]>
Signed-off-by: Jérôme Pouiller <[email protected]>
The siwx91x need a specific firmware image format. These image end with
.rps extension. The current name of the image is zephyr.bin.rps. However,
the .bin suffix is not relevant. It makes even more sense if we consider
the output of west sign: zephyr.signed.bin.rps. We can simplify these name
by remove the .bin suffix.

Signed-off-by: Jérôme Pouiller <[email protected]>
Copy link

``silabs_commander`` require `Simpliciy Commander`_ to be install on the host. The provisionning of the
key on the device is described in `UG574 SiWx917 SoC Manufacturing Utility User Guide`_.

.. _Simpliciy Commander:
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo

in_file = f'{kernel_prefix}.bin.rps'
out_file = command.args.sbin or f'{kernel_prefix}.signed.bin.rps'
in_file = f'{kernel_prefix}.rps'
out_file = command.args.sbin or f'{kernel_prefix}.signed.rps'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants