Commit be43ea89 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

boot: mynewt: add config for swap without scratch

Add Mynewt option to enable building a bootloader that uses an
alternative swap algorithm, that first moves up all sectors in slot1 and
then directly swaps between slot0 and slot1.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 114a6476
Loading
Loading
Loading
Loading
+2 −0
Changes for boot/mynewt/flash_map_backend/src/flash_map_extended.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -25,7 +25,9 @@ int flash_area_id_from_multi_image_slot(int image_index, int slot)
    switch (slot) {
    case 0: return FLASH_AREA_IMAGE_PRIMARY(image_index);
    case 1: return FLASH_AREA_IMAGE_SECONDARY(image_index);
#if MCUBOOT_SWAP_USING_SCRATCH
    case 2: return FLASH_AREA_IMAGE_SCRATCH;
#endif
    }
    return 255;
}
+3 −0
Changes for boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@
    MYNEWT_VAL(BOOTUTIL_ENCRYPT_EC256)
#define MCUBOOT_ENC_IMAGES 1
#endif
#if MYNEWT_VAL(BOOTUTIL_SWAP_USING_MOVE)
#define MCUBOOT_SWAP_USING_MOVE 1
#endif
#if MYNEWT_VAL(BOOTUTIL_OVERWRITE_ONLY)
#define MCUBOOT_OVERWRITE_ONLY 1
#endif
+3 −0
Changes for boot/mynewt/mcuboot_config/syscfg.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ syscfg.defs:
    BOOTUTIL_USE_TINYCRYPT:
        description: 'Use tinycrypt for crypto operations.'
        value: 0
    BOOTUTIL_SWAP_USING_MOVE:
        description: 'Perform swap without requiring scratch.'
        value: 0
    BOOTUTIL_OVERWRITE_ONLY:
        description: 'Non-swapping upgrades, copy from slot 1 to slot 0 only.'
        value: 0