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

bootutil: Add support for devices without erase #2114

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

Commits on Nov 15, 2024

  1. bootutil: Add support for devices without erase and reduced erases

    The commit adds two MCUboot configuration options:
      - MCUBOOT_DEV_WITHOUT_ERASE_THEN_NO_ERASE
      - MCUBOOT_MINIMAL_SCRAMBLE
    
    The first one should be enabled to support devices that do not require erase.
    When such devices are used in system then MCUboot will avoid erasing such
    device, which is not needed by hardware, and will just write data to it.
    This allows to both improve device lifetime and reduce time of operations
    like swap.
    
    The second option allows to reduce amount of removed data. When enabled,
    MCUboot will remove enough of data, depending on the purpose of the removal,
    to just fulfill the purpose; for example if removal of data is done to
    make image unrecognizable for MCUboot, with this option, it will only
    remove header.
    
    Signed-off-by: Dominik Ermel <[email protected]>
    de-nordic committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    6dd54da View commit details
    Browse the repository at this point in the history
  2. zephyr: Add support for devices without erase and reduced erases

    Add Kconfig options:
      - CONFIG_MCUBOOT_STORAGE_NO_UNNEEDED_ERASE that enables MCUboot
        configuration MCUBOOT_DEV_WITHOUT_ERASE_THEN_NO_ERASE
      - CONFIG_MCUBOOT_STORAGE_MINIMAL_SCRAMBLE that enables MCUboot
        configuration MCUBOOT_MINIMAL_SCRAMBLE
    
    Adds implementation of flash_area_erase_required, which is required when
    MCUBOOT_DEV_WITHOUT_ERASE_THEN_NO_ERASE is enabled.
    
    Signed-off-by: Dominik Ermel <[email protected]>
    de-nordic committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    e1a441d View commit details
    Browse the repository at this point in the history
  3. zephyr: Use flash_area_flatten in bs_custom_storage_erase

    The intention of bs_custom_storage_erase is to remove data from device;
    to support devices that do not require erase, without calling erase,
    so that devices that do not implement such functions could work,
    the flash_area_erase has been replaced with flash_area_flatten.
    
    Signed-off-by: Dominik Ermel <[email protected]>
    de-nordic committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    4edb7fc View commit details
    Browse the repository at this point in the history
  4. zephyr: Use flash_area_flatten in boot_set_next

    Switch from using flash_area_erase to flash_area_flatten.
    The later function uses write on devices that do not have erase by
    design, to scramble data.
    
    Signed-off-by: Dominik Ermel <[email protected]>
    de-nordic committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    b96fe4a View commit details
    Browse the repository at this point in the history