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

Using MCUBOOT_DATA_SHARING with multiple images prevents jumping into application #2212

Closed
pbesson-invn opened this issue Feb 20, 2025 · 3 comments

Comments

@pbesson-invn
Copy link

pbesson-invn commented Feb 20, 2025

Hello,

I want to use MCUBOOT_DATA_SHARING feature with nrf5340 which uses multiple images (NET+APP).

But doing so prevents booting to application because boot_add_shared_data() in boot/bootutil/src/loader.c is called twice from context_boot_go() when looping images. Indeed, with nrf5340, MCUBOOT_IMAGE_NUMBER is set to 2.

Second time boot_add_shared_data() is called, it returns SHARED_MEMORY_OVERWRITE which causes context_boot_go() to return an error and abort the boot process.

Anyway to workaround that ?

Thank you.

mcuboot version: daf2946a0f07

Same issue mentioned on Nordic DevZone: https://devzone.nordicsemi.com/f/nordic-q-a/115960/problem-with-data-sharing/509304

@nordicjm
Copy link
Collaborator

Doesn't really make sense because boot_save_shared_data() has this:

    if (saved_bootinfo) {
        /* Boot info has already been saved, nothing to do */
        return 0;
    }
...
    if (!rc) {
        saved_bootinfo = true;
    }

    return rc;

So if the first image update was OK then the second would be skipped

@pbesson-invn
Copy link
Author

Code you are referring to is not present in mcbuoot/nrf version I am using. It looks like you have added it recently: bcffc62

So I guess this issue can be closed.

Sorry for the trouble.

@nordicjm
Copy link
Collaborator

Use main of ncs and it should be fixed there

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

No branches or pull requests

2 participants