Skip to content
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

sysbuild: MCUboot fixes #15491

Merged
merged 3 commits into from
Jun 5, 2024
Merged

Conversation

nordicjm
Copy link
Contributor

No description provided.

Fixes an issue whereby MCUboot updates for secure boot were not
signed and thus could not be used

Signed-off-by: Jamie McCrae <[email protected]>
Adds the fixed ROM address of images to the signed images when
direct XIP mode is enabled

Signed-off-by: Jamie McCrae <[email protected]>
Adds an option that allows for not setting the number of updateable
images in the main application to the number that MCUboot supports,
this is needed for some nrf9160dk projects that have a single
update slot but use it for updating application and secure
bootloader

Signed-off-by: Jamie McCrae <[email protected]>
@nordicjm nordicjm requested a review from tejlmand as a code owner May 24, 2024 10:46
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label May 24, 2024
@NordicBuilder
Copy link
Contributor

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-sdk-find-my X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@nordicjm nordicjm removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label May 24, 2024
@carlescufi
Copy link
Contributor

@ArekBalysNordic @sigvartmh @nvlsianpu @de-nordic please review ASAP

bool "Sync updateable image value to main application"
default y
help
If enabled then will synchronise the value of ``MCUBOOT_UPDATEABLE_IMAGES`` to MCUboot
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean the UPDATEABLE_IMAGE_NUMBER or the MCUmgr Kconfig MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER?
(The MCUBOOT_UPDATEABLE_IMAGES is something new? I can not find it...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MCUBOOT_UPDATEABLE_IMAGES is the sysbuild setting, if this is set then it will set it to both mcuboot and application, if not then it will only set it to mcuboot... though not sure why the help text mentions mcuboot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have re-read the text and main application is on the line after, so is correct

@@ -69,7 +69,7 @@ function(ncs_secure_boot_mcuboot_sign application bin_files signed_targets prefi
# Hence, if a programmer is given this hex file, it will flash it
# to the secondary slot, and upon reboot mcuboot will swap in the
# contents of the hex file.
${imgtool_sign} ${PROJECT_BINARY_DIR}/signed_by_b0_${application}.bin ${output}.bin
${imgtool_sign} ${imgtool_extra} ${PROJECT_BINARY_DIR}/signed_by_b0_${application}.bin ${output}.bin
Copy link
Contributor

Choose a reason for hiding this comment

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

the use of imgtool_extra is actually problematic because it will inherit imgtool_extra from parent scope value which can result in surprises.

Use of imgtool_extra should be an argument to the function here:

function(ncs_secure_boot_mcuboot_sign application bin_files signed_targets prefix)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it won't inherit anything because this is from a sysbuild context, there is no imgtool_extra variable in sysbuild

@nordicjm nordicjm requested a review from tejlmand June 4, 2024 12:42
@ArekBalysNordic
Copy link
Contributor

@ArekBalysNordic @sigvartmh @nvlsianpu @de-nordic please review ASAP

@doublemis1 Could you please check whether our DFU tests work with this PR?

@carlescufi carlescufi merged commit 4e3265d into nrfconnect:main Jun 5, 2024
15 checks passed
@nordicjm nordicjm deleted the sysbuildaddromfixed branch November 6, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants