-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for three images in sdk-nrf #12025
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
Test specificationCI/Jenkins/NRF
CI/Jenkins/integration
test-ci-nrfconnect-boot-fw-update: added because there was no .github/test-spec.yml in 'mcuboot' Detailed information of selected test modules Note: This message is automatically posted and updated by the CI |
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
35940fa
to
91bf297
Compare
Matter plans failed due to issue with mcumgr:
|
Does this try to confirm running slot? |
Before confirmation the image list looks as follow:
It is only a one image (APP core) in following test steps we do upload another image (NET core) and then we would also confirm the second image. |
OK, so this must be some bug around |
e3f159d
to
ddcb202
Compare
Third image partition names. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Update sdk-mcuboot and sdk-zephyr revisions to bring in changes required for support of three images. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
ddcb202
to
c6b299a
Compare
Changes already in main. |
Contains:
Update 2023-08-16 14:57 UTC
The PR, and all other connected PRs, have been updated to the latest sdk-nrf main pointed revisions.
Update 2023-08-17 16:11 UTC
Zephyr PR has been updated to bring in changes from upstream PRs.
Update 2023-08-18 11:10 UTC
Fixed Zephyr PR where one commit has been missing.
Update 2023-08-18 11:16 UTC
Update from main branch to remove merge conflict.
Update 2023-08-18 18:15 UTC
Update from upstream PRs and rebase over main.
Update 2023-08-22 22:10 UTC
Rebase on sdk-nrf main, with all dependent repo changes, and bring in update to commits done upstream.
TODO:
Testing and building
The configuration has been tested with nrf52840dk using pseudo images for image 1 and 2, as the do not have to boot, although there is no problem with using real applications but without cores to run them there is no point.
As DFU method the smp_svr has been used with static partition definition
pm_static.txt
(the file needs to be copied to zephyr/samples/subsys/mgmt/mcumgr/smp_svr and renamed pm_static.yml prior to building).
The file defines two additional images (four slots) of size 65k (0x10000) where the second and third images would reside, increases MCUboot slot to 65k (that may not be needed, but I was worried that logging may require it) and does not define andy storage.
When three (or two) image configuration is used, MCUboot needs to find valid image in primary slot of every image, otherwise it will refuse to boot. That is why bogus images are created and programmed with the smp_svr sample.
The primary smp_svr is built using command:
where
are Kconfig settings that increase logging to debug for MCUboot and MCUmgr (can be discarded if not needed),
set support for three images in MCUboot and MCUmgr,
disable usage of storage, which is not allocated in pm_static.yml used here,
sets version the three_smp_svr will be signed with, and
allows MCUmgr client to confirm slots of non-running image, which normally is not allowed to prevent confirming something that will not boot, but in this case we are confirming "other part" of image so we need to be able to do that.
When the three_smp_svr is built it can be flashed using, with MCUboot, using:
But this will unfortunately give us
as there is no valid application for image 1 and image 2.
For the purpose of testing the bogus applications have been generated:
Note that both apps have the same slot size, 0x10000, as defined by pm_static.yml, but haxes have different start address as according to pm_static.yml primary slot of image 1 starts at 0x90000 and primary slot of image 2 starts at 0xb0000.
The key used with imgtool is here the default key, as used with building the smp_svr and MCUboot.
Images are programmed with:
and after reset we can see:
Using the mcumgr-cli image list command, for example:
we will get output for three images
hashes will of course be different.
Now it is possible to upload additional images to slots, for example additional smp_svr with different version can be built for slot 0, and uploaded using mcumgr-cli:
the
-e
is important as it means that mcumgr-cli should not send separate erase command and-n 0
selects image 0 as target for upload;-n 1
would select image one and so on.To have a test payload for other images, they can be generated in similar way the hex have been generated:
there is no need to generate hex.