esp-hal
esp-hal copied to clipboard
[RFC] Explore and decide on a bootloader option
As things currently stand, we've been using the ESP-IDF bootloader, this has historically been for simplicity, but also the fact that we get compatibility with much of the IDF tooling. There is a strong argument to stick with this, but before we make a decision we should evaluate the other options.
I am of the opinion, that other than the esp-idf bootloader, if we choose a bootloader it should be written in Rust, to avoid complicated build steps, or in the case of esp-idf's bootloader, integration with tooling (pre built bootloaders within espflash/probe-rs).
embassy-boot
embassy-boot (docs) is a lightweight bootloader which supports
- DFU upgrades (on chips with USB)
- OTA (one slot only it seems)
- Image signing
- Support is provided mostly through the embedded-storage traits, but may also require some glue code for specific startup code on some chips
- There isn't support for esp-idf's secure boot OOTB, but I believe this could be added with our implementation.
mcuboot-rs
mcuboot-rs is a implementation of mcuboot, but in Rust. It is currently in PoC status.
- Will eventually support all the features of mcuboot
- This includes secure boot and signed images
- Only supports LPC55S69 right now
ROM bootloader image format
One unresolved issue is how to take a bootloader elf produced from Rust code, and get it into a format where by the ROM code bootloader (in non-direct boot mode) will understand, see this. Post build steps aren't really a thing in cargo, so we'd need a way to solve this. Unless of course we don't, we could just make the bootloader flashing a one-time step that a user has to do from time to time.