-
Notifications
You must be signed in to change notification settings - Fork 1.4k
sysbuild: mcuboot: direct_xip: enable custom overlay for secondary slot #24561
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
kapi-no
wants to merge
1
commit into
nrfconnect:main
Choose a base branch
from
kapi-no:sysbuild_mcuboot_direct_xip_custom_secondary_overlay
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.
+14
−1
Open
Changes from all commits
Commits
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
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
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.
this is not acceptable. If you want to append a new file then doing that should work via command line
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.
We don't want to use a CLI parameter to override the DTS overlay file because the build command becomes complex (actually, you need to replace overlays for two secondary variants of the following images: the default application image and IPC radio).
There is also a guideline/requirement from PMT to make the default build command work in a given project. So the following command should work without any extra params:
Since there is already a mechanism that injects the overlay file from an arbitrary location (
nrf/subsys/mcuboot/mcuboot_secondary_app.overlay
), can't we simply introduce the possibility to change the path and pass your own DTS overlay?Also, right now, you can't remove the
nrf/subsys/mcuboot/mcuboot_secondary_app.overlay
overlay, which is added to your secondary images automatically.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.
@kapi-no but the sample already builds out-of-the-box, correct ?
afaict the
mcuboot_secondary_app.overlay
is always applied, so what you're tryin (correct me if i'm wrong) is for users to choose their own overlay.For this, as @nordicjm points out, sysbuild already supports the use of
-D<image>_DTC_OVERLAY_FILE=<user-custom-file>.overlay
, so why not change the code into droppingadd_overlay_dts(${image} "${secondary_overlay}")
if custom overlay for image is set ?Instead of inventing Kconfig setting for this.
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.
In the simple MCUboot direct-xip use case scenario, where we have a default application image (built for slot0) and its secondary counterpart (built for slot1) -> yes.
However, when each slot holds two images (merged binary configuration for the nRF54H20): the default application image and the IPC radio image -> the default overlay configuration from the
nrf/subsys/mcuboot/mcuboot_secondary_app.overlay
is broken.See the following comment for more context: #24494 (comment)
Yes
We always strive to have the default build command working for each supported target. Requiring extra parameters breaks this requirement.
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.
but ensuring that a default build command for a given target always work is not necessarily the same as supporting custom user provided files.
Is the
nrf54h20dk/nrf54h20/cpuapp
not working with the currently used / default appliedmcuboot_secondary_app.overlay
file ?In short, does
west build -p -b nrf54h20dk/nrf54h20/cpuapp --sysbuild
fail today ?There is no Jira task reference provided, so I'm a bit unsure exactly what you're trying to solve here.
west build -p -b nrf54h20dk/nrf54h20/cpuapp --sysbuild
?If this is not working, then we should have an issue describe what and why this is not working.
Of course a user wanting to provide their own overlay must be expected to do some work of their own.
Even with the use if a Kconfig proposol in this PR they would need to set the value somehow, for example:
-DMCUBOOT_BUILD_DIRECT_XIP_VARIANT_CUSTOM_OVERLAY=<file>.overlay
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.
Generally, the ROM footprint statistics for the nRF54H20 images in the merged binary approach are incorrect. More details can be found in the following ticket:
NCSDK-35489
The code partition for the application image is defined in such a way that it also contains the radio partition.
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.
If I understand NCSDK-35489 then the issue exists for all samples building for nRF54h20dk, so isn't it simply the original
mcuboot_secondary_app.overlay
intended for the nrf54h20dk which is wrong and should be fixed ?ef85447
Secondly, if a sample wants to provide custom overlays for images and have those applied per default, then that is also possible. Can even be board specific: https://docs.zephyrproject.org/latest/build/sysbuild/index.html#zephyr-application-configuration
If none of the existing solutions are suitable, then I believe it will be more efficient if you set up a meeting and invite relevant parties.
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.
Yes, at least with the merged binary approach. I haven't tested the DFU solution with isolated binaries, as we want to use one version number for the image set (application + radio image) to minimize complexity in our project.
Well, I am aware of the application configuration directory solution. We use it in the nRF Desktop app where I initially want to use the suggested change in this PR. I know I can create the configuration from scratch for both the
mcuboot_secondary_app
and theipc_radio_secondary_app
images. However, this requires copying over 1000 lines of configuration files (at least for themcuboot_secondary_app
) to change one DTS node. And even then, the default file -nrf/subsys/mcuboot/mcuboot_secondary_app.overlay
- will be applied.