-
Notifications
You must be signed in to change notification settings - Fork 8.1k
west: runners: nrfutil: Add key file when present to west flash command #90605
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
west: runners: nrfutil: Add key file when present to west flash command #90605
Conversation
eb548ec
to
3a452fa
Compare
3a452fa
to
47ae67c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding all this NCS stuff into Zephyr? We need to figure out a better way where Zephyr remains clean of code needed only by a downstream and supported completely there.
I agree with you about keeping downstream-specific code in the downstream repository, but I don't see an easy way to accomplish this (maybe to implement something like hooks that could be registered in the downstream project?) I initially implemented this as a proof of concept in the downstream repository, but this created maintenance challenges when dealing with differences between repositories. The primary motivation for including the NCS provisioning feature was to enable testing with Twister. It's worth noting that this functionality is:
|
Agreed, and this is already the case for almost all code in Zephyr, by extending the codebase in NCS itself. As @gchwier described, there are three real options in this particular case, due to the requirements of influencing the sequence of operations during flashing:
|
Looking at the PR, why is generating a keyfile put into the twister runner? writing a keyfile to a target, sure, generating it? Seems this should be handled by a downstream script invoked by CMake, and passed to the runner like any other binary files. Case in point:
so, we already use Kconfigs here, just pass those to CMake instead? |
I must look into cmake scripts in sdk-nrf. I see that provisioning could be solved with:
I will try it, thank you! |
Check out https://github.com/zephyrproject-rtos/zephyr/tree/main/soc/nordic/nrf54h/bicr where we do something like this :) |
Thanks @bjarki-andreasen! If the file generation can be kept out of vanilla Zephyr then it’d be just about adding a new |
I was rather thinking to not add any new parameter. Just check the build directory and if key file exists then run key provisioning. |
dcd260f
to
c3dbbc8
Compare
Added automatic KMU key provisioning, when keyfile.json file exists in the build directory. This enables automated key provisioning during the flashing process to enable testing nRF54L aplications using Twister. Only applicable on nrfutil runner. Signed-off-by: Grzegorz Chwierut <[email protected]>
c3dbbc8
to
807e0ad
Compare
|
@carlescufi @nvlsianpu I've added some changes in sdk-nrf (Kconfigs and keyfile.json generation from the build process) with some examples of usage: |
@gchwier @carlescufi |
Added automatic KMU key provisioning, when keyfile.json
file exists in the build directory.
This enables automated key provisioning during the
flashing process to enable testing nRF54L aplications using Twister.
Only applicable on nrfutil runner.