-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add split-slot A/B sample #25036
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
base: main
Are you sure you want to change the base?
Add split-slot A/B sample #25036
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 2 projects with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:more detailsGithub labels
List of changed files detected by CI (0)Outputs:ToolchainVersion: Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
Memory footprint analysis revealed the following potential issuesapplications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 9102[B] - link (cc: @nrfconnect/ncs-ll-ursus) Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-25036/2) |
b649761 to
40e458e
Compare
40e458e to
f89b505
Compare
f89b505 to
85cf3c7
Compare
4d98c2a to
c194719
Compare
Add a copy of the img_mgmt.c file, so it can be adjusted to work with all NCS-specific extensions. Zephyr revision: 25269118b5069ebb72316d2a26bdedbe6ba8de95 Signed-off-by: Tomasz Chyrowicz <[email protected]>
Adds handling code to allow selecting the correct image slot when using QSPI XIP in DirectXIP mode In case of Direct XIP and multiple images, the radio active slot changes accordingly (i.e. application slot 1 boots radio slot 1). Moved from sdk-zephyr commit: 0fb761832466933b322fb8030c9ec934b62aa128 Signed-off-by: Jamie McCrae <[email protected]> Signed-off-by: Tomasz Chyrowicz <[email protected]>
The "zephyr-code-partition" chosen DTS node cannot be used when build uses Partition Manager. In that case, mcumgr must rely on the definitions provided by the Partition Manager. Jira: NCSDK-21381 Moved from sdk-zephyr commit: e6d6cc0c6ada8c69a021c5bbc13f52831c7c53a3 Signed-off-by: Marek Pieta <[email protected]> Signed-off-by: Dominik Ermel <[email protected]> Signed-off-by: Tomasz Chyrowicz <[email protected]>
Add a possibility to automatically generate a MCUboot manifest with all expected image's digests. Signed-off-by: Tomasz Chyrowicz <[email protected]>
c194719 to
5a78c42
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.
Pull Request Overview
This PR adds A/B update sample variant demonstrating multi-image firmware updates through MCUboot manifests with digests, enabling transactional updates of multiple images atomically. The implementation introduces manifest-based dependency management for split-slot DirectXIP configurations.
Key Changes:
- Adds manifest-based transactional update support in MCUboot configuration
- Implements a new A/B split-slot sample demonstrating separated application and radio core images
- Updates image management code to handle manifest verification and slot selection
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| west.yml | Updates Zephyr and MCUboot revisions to pull requests supporting manifest features |
| sysbuild/Kconfig.mcuboot | Adds Kconfig options for manifest-based transactional updates |
| sysbuild/CMakeLists.txt | Implements manifest image target assignment and configuration propagation |
| subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt_state.c | Modifies slot state handling to use manifest image when manifest updates enabled |
| subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c | Adds full img_mgmt implementation with manifest verification support |
| subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig | Adds QSPI XIP split image configuration option |
| subsys/mgmt/mcumgr/grp/img_mgmt/CMakeLists.txt | Updates build to include new img_mgmt.c and marks upstream file as header-only |
| subsys/bootloader/Kconfig | Adds application-side Kconfig options for manifest updates |
| scripts/ci/license_allow_list.yaml | Adds img_mgmt.c to Apache-2.0 license allowlist |
| samples/dfu/ab_split/* | New sample demonstrating A/B updates with separated slots and manifest-based dependencies |
| cmake/sysbuild/mcuboot_manifest.cmake | Implements manifest YAML generation for primary and secondary slots |
| cmake/sysbuild/image_signing.cmake | Adds manifest appending to imgtool signing process |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #endif | ||
| }; | ||
|
|
||
| static const struct mgmt_handler img_mgmt_handlers[]; |
Copilot
AI
Nov 4, 2025
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.
Forward declaration of 'img_mgmt_handlers' is redundant since the array is already fully defined at line 1224. This forward declaration should be removed to avoid confusion.
| static const struct mgmt_handler img_mgmt_handlers[]; |
5a78c42 to
732b90c
Compare
732b90c to
0dcb062
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.
Pull Request Overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0dcb062 to
4a63b81
Compare
Add routines to parse and check manifest state. Signed-off-by: Tomasz Chyrowicz <[email protected]>
Add a variant of the A/B sample that presents how to perform A/B updates in a system, where application and radio images uses separate images and slots. Ref: NCSDK-35733 Signed-off-by: Tomasz Chyrowicz <[email protected]>
4a63b81 to
886a5ae
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.
Pull Request Overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| rc = img_mgmt_find_tlvs(image_slot, &data_off, &data_end, IMAGE_TLV_PROT_INFO_MAGIC); | ||
| if (rc != 0) { | ||
| return IMG_MGMT_ERR_NO_TLVS; |
Copilot
AI
Nov 5, 2025
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.
Incorrect return type: function boot_check_manifest returns bool but IMG_MGMT_ERR_NO_TLVS is an integer error code. Should return false instead.
| return IMG_MGMT_ERR_NO_TLVS; | |
| return false; |
| If it is defined, the application is running from slot B. | ||
| Otherwise, it is running from slot A. | ||
|
|
||
| If the project does not use the Partition Manager (a configuration currently only supported on the nRF54H20), the currently running slot can be identified by comparing the address pointed `zephyr,code-partition` to specific node addresses defined in the device tree. |
Copilot
AI
Nov 5, 2025
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.
Corrected 'pointed' to 'pointed to by' for grammatical accuracy.
| If the project does not use the Partition Manager (a configuration currently only supported on the nRF54H20), the currently running slot can be identified by comparing the address pointed `zephyr,code-partition` to specific node addresses defined in the device tree. | |
| If the project does not use the Partition Manager (a configuration currently only supported on the nRF54H20), the currently running slot can be identified by comparing the address pointed to by `zephyr,code-partition` to specific node addresses defined in the device tree. |
Add A/B sample variant, that describe multi-image FW through a MCUboot manifest with digests.