-
Notifications
You must be signed in to change notification settings - Fork 19
sysbuild: Add KMU provisioning and allow KMU usage #357
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
nordicjm
wants to merge
8
commits into
nrfconnect:main
Choose a base branch
from
nordicjm:kmuprovision
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4d470f2
scripts: requirements: Add python-dotenv to required python pacakges
nordicjm ffa7618
manifest: Update sdk-nrf
nordicjm 93aee28
sysbuild: Add KMU provisioning and allow KMU usage
nordicjm 71e1c0b
samples: boot: mcuboot_recovery_retention: Add KMU build
nordicjm b124956
doc: app_dev: dfu: bootloader_keys: Add section on KMU
nordicjm f081eff
sysbuild: Add default (overridable) MCUboot Kconfigs without clock
nordicjm 8f07259
boards: nordic: bm_nrf54l15dk: Reduce MCUboot partition size
nordicjm 08945ba
doc: app_dev: dfu: Update minimum sizes for bootloader
nordicjm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,14 +48,14 @@ | |
|
||
boot_partition: partition@0 { | ||
label = "boot"; | ||
reg = <0x00000000 DT_SIZE_K(36)>; | ||
reg = <0x00000000 DT_SIZE_K(31)>; | ||
}; | ||
|
||
storage_partition: partition@9000 { | ||
storage_partition: partition@7c00 { | ||
compatible = "fixed-subpartitions"; | ||
label = "storage"; | ||
reg = <0x00009000 DT_SIZE_K(8)>; | ||
ranges = <0x0 0x9000 DT_SIZE_K(8)>; | ||
reg = <0x00007c00 DT_SIZE_K(8)>; | ||
ranges = <0x0 0x7c00 DT_SIZE_K(8)>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
|
@@ -70,9 +70,11 @@ | |
}; | ||
}; | ||
|
||
slot0_partition: partition@b000 { | ||
/* Area from 0x9c00 to 0xa000 is unused due to alignment */ | ||
|
||
slot0_partition: partition@a000 { | ||
label = "slot0"; | ||
reg = <0x0000b000 DT_SIZE_K(282)>; | ||
reg = <0x000a000 DT_SIZE_K(286)>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The board yaml files must be updated. |
||
}; | ||
|
||
slot1_partition: partition@51800 { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
# This script defines a CMake target 'generate_kmu_keyfile_json' to create keyfile.json | ||
# using 'west ncs-provision upload --dry-run'. | ||
|
||
# --- Construct the list of commands and dependencies --- | ||
set(kmu_json_commands "") | ||
set(kmu_json_dependencies "") | ||
|
||
# Update keyfile for BL_PUBKEY | ||
string(CONFIGURE "${SB_CONFIG_BM_BOOTLOADER_MCUBOOT_SIGNATURE_KEY_FILE}" mcuboot_signature_key_file) | ||
list(APPEND kmu_json_commands | ||
COMMAND ${Python3_EXECUTABLE} -m west ncs-provision upload | ||
--keyname BL_PUBKEY | ||
--key ${mcuboot_signature_key_file} | ||
--build-dir ${CMAKE_BINARY_DIR} | ||
--dry-run | ||
) | ||
list(APPEND kmu_json_dependencies ${mcuboot_signature_key_file}) | ||
|
||
# --- Add custom command to generate/update keyfile.json --- | ||
if(NOT kmu_json_commands STREQUAL "") | ||
add_custom_command( | ||
OUTPUT ${CMAKE_BINARY_DIR}/keyfile.json | ||
${kmu_json_commands} # Expands to one or more COMMAND clauses | ||
DEPENDS ${kmu_json_dependencies} | ||
COMMENT "Generating/Updating KMU keyfile JSON (${CMAKE_BINARY_DIR}/keyfile.json)" | ||
VERBATIM | ||
) | ||
|
||
# --- Add custom target to trigger the generation --- | ||
add_custom_target( | ||
generate_kmu_keyfile_json ALL | ||
DEPENDS ${CMAKE_BINARY_DIR}/keyfile.json | ||
) | ||
endif() |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doc is fine - can be tweaked by the writes based on NCS doc content, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ setuptools | |
wheel | ||
west | ||
gitlint | ||
python-dotenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CONFIG_KERNEL_MEM_POOL=n | ||
CONFIG_CURRENT_THREAD_USE_TLS=n | ||
CONFIG_ERRNO=n | ||
CONFIG_FP16=n | ||
CONFIG_HW_STACK_PROTECTION=n | ||
CONFIG_BUILTIN_STACK_GUARD=n | ||
CONFIG_TIMEOUT_64BIT=n | ||
CONFIG_SYS_CLOCK_EXISTS=n | ||
CONFIG_NRF_GRTC_START_SYSCOUNTER=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we add this to storage? E.g. as a 1k storage1_partition?
Or is there no point as we expect the boot_partition size to be further reduced?
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.
It can be added to storage but will leave that to a future PR (the partitions might also be reworked in future to better utilise size)
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.
Ok by me :)