bootutil: fix upgrade issue in swap-move

A previous fix for allowing padded images in the primary slot, ended up
causing an issue that would fail to upgrade under the right
circumstances. The issue was caused when the following set of steps
happened after an upgrade was detected:

1) trailer is erased on the primary slot
2) status is written to the primary slot
3) trailer is erased on the secondary slot
4) reset
1) trailer is erased on the primary slot
2) status partially written or not written to primary slot (no magic)
3) reset

This would result in images stored in the same slots they were
initially, aka no upgrade, which would fail the simulator test for
upgraded images.

The previous padded images fix was reverted and the status source was
upgraded to also check that the secondary slot has a valid magic in it,
so that there's never a circumstance where there is no trailer in any
of the slots while an upgrade operation is being decided on.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
1 file changed
tree: fc2337ad8c14f9fe9314952ee11da099c0913f9f
  1. .github/
  2. boot/
  3. ci/
  4. docs/
  5. ext/
  6. ptest/
  7. samples/
  8. scripts/
  9. sim/
  10. testplan/
  11. zephyr/
  12. .gitignore
  13. .gitmodules
  14. .travis.yml
  15. enc-aes128kw.b64
  16. enc-ec256-priv.pem
  17. enc-ec256-pub.pem
  18. enc-rsa2048-priv.pem
  19. enc-rsa2048-pub.pem
  20. enc-x25519-priv.pem
  21. enc-x25519-pub.pem
  22. go.mod
  23. LICENSE
  24. NOTICE
  25. project.yml
  26. README.md
  27. repository.yml
  28. root-ec-p256-pkcs8.pem
  29. root-ec-p256.pem
  30. root-ed25519.pem
  31. root-rsa-2048.pem
  32. root-rsa-3072.pem
README.md

mcuboot

Coverity Scan Build Status Build/Test

This is mcuboot version 1.6.0

MCUboot is a secure bootloader for 32-bit MCUs. The goal of MCUboot is to define a common infrastructure for the bootloader, system flash layout on microcontroller systems, and to provide a secure bootloader that enables simple software upgrades.

MCUboot is operating system and hardware independent and relies on hardware porting layers from the operating. Currently, mcuboot works with both the Apache Mynewt and Zephyr operating systems, but more ports are planned in the future. RIOT is currently supported as a boot target with a complete port planned.

Using MCUboot

Instructions for different operating systems can be found here:

Roadmap

The issues being planned and worked on are tracked using GitHub issues. To participate please visit:

MCUBoot GitHub Issues

Issues were previously tracked on MCUboot JIRA , but it is now deprecated.

Browsing

Information and documentation on the bootloader are stored within the source.

It was previously also documented on confluence: MCUBoot Confluence however, it is now deprecated and not currently maintained

For more information in the source, here are some pointers:

  • boot/bootutil: The core of the bootloader itself.
  • boot/boot_serial: Support for serial upgrade within the bootloader itself.
  • boot/zephyr: Port of the bootloader to Zephyr
  • boot/mynewt: Mynewt bootloader app
  • imgtool: A tool to securely sign firmware images for booting by mcuboot.
  • sim: A bootloader simulator for testing and regression

Joining

Developers welcome!