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

mcuboot: add support for new "copy with revert" algorithm #1902

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Apr 23, 2024

  1. boot: generalize boot_write_image_ok() function to get flag as parameter

    This commit generalizes boot_write_image_ok() function to take flag
    as an input parameter. Function is also rename to boot_write_image_flag()
    so the name matches the usage better.
    
    This is useful to future implementation of different algorithms that
    might need other flags than BOOT_FLAG_SET to be written to image
    trailer.
    
    Signed-off-by: Michal Lenc <michallenc@seznam.cz>
    michallenc committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    1acec48 View commit details
    Browse the repository at this point in the history
  2. boot: add new copy with revert algorithm

    This algorithm uses three flash partitions to copy images to primary slot
    without swap mechanism. This way much faster update process can be
    achieved but more space on flash has to be allocated. This is basically
    trade off between update speed and flash space taken for boot process.
    
    The algorithm always keeps recovery image in either secondary or
    tertiary slot and lets the user upload update image to the other one.
    Once image is updated and confirmed, update slot is marked as recovery
    (the image is already there uploaded by the user) and old recovery is
    marked as new update -> user will upload new image there. This means
    there are no writes to ota1 and ota2 partitions during boot process
    except and therefore there is no speed limitation if usually slower
    (compared to embedded flash) external NOR flash is used for these
    partitions. The only exception is first update process where bootloader
    has to create recovery image.
    
    Overall, this algorithm allows to achieve the speed of overwrite only
    algorithm while retaining the revert/recovery option. It is especially
    useful for devices with larger images and a lot of free space on
    external flash.
    
    Signed-off-by: Michal Lenc <michallenc@seznam.cz>
    michallenc committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    8a3150a View commit details
    Browse the repository at this point in the history
  3. docs: add entry for new copy with revert algorithm

    This commit adds documentation entry for new algorithm.
    
    Signed-off-by: Michal Lenc <michallenc@seznam.cz>
    michallenc committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    b407080 View commit details
    Browse the repository at this point in the history
  4. boot/nuttx: add configuration for tertiary slot

    This slot is used in newly introduced copy with revert algorithm. This
    commit allows NuttX to support this algorithm.
    
    Signed-off-by: Michal Lenc <michallenc@seznam.cz>
    michallenc committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    8110ce5 View commit details
    Browse the repository at this point in the history