Commit a671d928 authored by Andrzej Puzdrowski's avatar Andrzej Puzdrowski
Browse files

synch witch upstream commit 85da97f2

synch up to upstream:
https://github.com/mcu-tools/mcuboot/commit/85da97f2fb4b9c5f53fae5e58d7b4201e33d4688

- introduce MCUBOOT_CPU_IDLE() for support low power single thread
- Allow not working secondary image device and boot form primary device if image available

Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parents ca01db42 85da97f2
Loading
Loading
Loading
Loading
+2 −1
Changes for .github/workflows/stale_issue.yml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -14,10 +14,11 @@ jobs:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        stale-pr-message: 'This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.'
        stale-issue-message: 'This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.'
        days-before-stale: 60
        days-before-stale: 180
        days-before-close: 14
        stale-issue-label: 'stale'
        stale-pr-label: 'stale'
        exempt-issue-labels: 'someday'
        # exempt-pr-labels: 'Blocked,In progress'
        # exempt-issue-labels: 'In progress,Enhancement,Feature,Feature Request,RFC,Meta'
        operations-per-run: 400
+1 −0
Changes for boot/boot_serial/src/boot_serial.c: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -613,6 +613,7 @@ boot_serial_start(const struct boot_uart_funcs *f)

    off = 0;
    while (1) {
        MCUBOOT_CPU_IDLE();
        rc = f->read(in_buf + off, sizeof(in_buf) - off, &full_line);
        if (rc <= 0 && !full_line) {
            continue;
+1 −0
Changes for boot/bootutil/include/bootutil/bootutil_public.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ extern "C" {
#define BOOT_ENOMEM      6
#define BOOT_EBADARGS    7
#define BOOT_EBADVERSION 8
#define BOOT_EFLASH_SEC  9

/*
 * Extract the swap type and image number from image trailers's swap_info
+8 −3
Changes for boot/bootutil/src/boot_record.c: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -62,13 +62,18 @@ boot_add_data_to_shared_area(uint8_t major_type,

    boot_data = (struct shared_boot_data *)MCUBOOT_SHARED_DATA_BASE;

    /* Check whether first time to call this function. If does then initialise
     * shared data area.
    /* Check whether first time to call this function. If it is, then check
     * whether the shared data area needs to be initialised.
     */
    if (!shared_memory_init_done) {
        memset((void *)MCUBOOT_SHARED_DATA_BASE, 0, MCUBOOT_SHARED_DATA_SIZE);
        if ((boot_data->header.tlv_magic != SHARED_DATA_TLV_INFO_MAGIC) ||
            (boot_data->header.tlv_tot_len > MCUBOOT_SHARED_DATA_SIZE)) {
            memset((void *)MCUBOOT_SHARED_DATA_BASE, 0,
                           MCUBOOT_SHARED_DATA_SIZE);
            boot_data->header.tlv_magic   = SHARED_DATA_TLV_INFO_MAGIC;
            boot_data->header.tlv_tot_len = SHARED_DATA_HEADER_SIZE;
        }

        shared_memory_init_done = true;
    }

+9 −1
Changes for boot/bootutil/src/bootutil_public.c: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -425,7 +425,15 @@ boot_swap_type_multi(int image_index)

    rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index),
                                    &secondary_slot);
    if (rc) {
    if (rc == BOOT_EFLASH) {
        BOOT_LOG_INF("Secondary image of image pair (%d.) "
                     "is unreachable. Treat it as empty", image_index);
        secondary_slot.magic = BOOT_MAGIC_UNSET;
        secondary_slot.swap_type = BOOT_SWAP_TYPE_NONE;
        secondary_slot.copy_done = BOOT_FLAG_UNSET;
        secondary_slot.image_ok = BOOT_FLAG_UNSET;
        secondary_slot.image_num = 0;
    } else if (rc) {
        return BOOT_SWAP_TYPE_PANIC;
    }

Loading