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

boot: zephyr: boot_record: Save boot data with single image #2138

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

dpw13
Copy link
Contributor

@dpw13 dpw13 commented Dec 5, 2024

Ensure that bootloader info and measurements are saved to retained memory when using mcuboot in single-image mode.

@de-nordic de-nordic added the area: zephyr Affects the Zephyr port label Dec 5, 2024
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Some fields should be excluded from single application mode, can you update boot/bootutil/src/boot_record.c and add ifdefs like so:

#if !defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
    if (!rc) {
        rc = boot_add_data_to_shared_area(TLV_MAJOR_BLINFO,
                                          BLINFO_RUNNING_SLOT,
                                          sizeof(slot), (void *)&slot);
    }
#endif
...
#if !defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
    while (image < BOOT_IMAGE_NUMBER && !rc) {
        if (max_app_sizes[image].calculated == true) {
            rc = boot_add_data_to_shared_area(TLV_MAJOR_BLINFO,
                                              (BLINFO_MAX_APPLICATION_SIZE + image),
                                              sizeof(max_app_sizes[image].max_size),
                                              (void *)&max_app_sizes[image].max_size);

        }

        ++image;
    }
#endif

@dpw13 dpw13 force-pushed the dwagner/single-loader-blinfo branch from e9629b2 to f1a184b Compare December 6, 2024 16:03
@dpw13 dpw13 requested a review from davidvincze as a code owner December 6, 2024 16:03
@dpw13 dpw13 requested a review from nordicjm December 6, 2024 16:03
@dpw13 dpw13 force-pushed the dwagner/single-loader-blinfo branch from f1a184b to 1528e48 Compare December 6, 2024 16:12
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

nit. and will be good to go

boot/bootutil/src/boot_record.c Show resolved Hide resolved
boot/bootutil/src/boot_record.c Outdated Show resolved Hide resolved
Ensure that bootloader info and measurements are saved to retained
memory when using mcuboot in single-image mode.

Signed-off-by: Dane Wagner <[email protected]>
@dpw13 dpw13 force-pushed the dwagner/single-loader-blinfo branch from 1528e48 to d5cca5a Compare December 9, 2024 14:24
@dpw13 dpw13 requested a review from nordicjm December 9, 2024 14:25
@nordicjm nordicjm merged commit f2a6146 into mcu-tools:main Dec 10, 2024
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: zephyr Affects the Zephyr port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants