-
Notifications
You must be signed in to change notification settings - Fork 240
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
[RFC] Explore and decide on a bootloader option #1973
Comments
|
I'm quite ignorant to this bootloader topic but is it possible to let users choose? Are there parts of the hal that assume esp-idf's bootloader is being used? |
Of course! Sorry, I should have outlined this in the OP. What I meant is that we should decide on an OOTB solution that most users will use. Advanced users can of course do whatever they like. The main reason for this discussion is that OTA is essentially a hard requirement for any project, and OTA requires some level of coordination from the bootloader.
In theory, no, we had direct-boot support for a while and things just worked, but it's possible we may have baked in an assumption here or there over time. |
Let me add some info here and some experience from working in NON-ESP-IDF systems... Bootloaders for Espressif DevicesCurrently, on C-Based systems, there are 4 options of booting Espressif devices:
And we can add a Rust solution to the list.
That said, I would rule out IDFboot and DirectBoot as there is a lot of code that is ESP-IDF dependent and not much agnostic. I won't mention them forward. Neither any inactive project. SimplebootSimpleboot is more like looking into some functions and translate them to an analog in Rust. Maybe an option for the leanest of the options. The necessity is debatable, as it was only made because some Embedded OSes have a 'bootloader-less' option. ESP-TOOL was already modified to support this. MCUboot:
Embassy Boot
Security
|
embassy-boot is designed for devices without an MMU and while making it work isn't bad, I would not consider it something we should prioritise for. None of the ESP32 devices need to deal with the page-by-page swapping algorithm it uses, which just wears down flash faster than necessary. |
I haven't look into it with detail, but as in most cases of update, products usually don't do that often, (lets say a long term devices sees 50 updates in 5-10 years), should not be a problem. |
Given that, at least to the best of my understanding, we are planning on moving forward with mcuboot support, I guess there is a final decision to be made here and we can close this issue: Do we plan to support both the ESP-IDF bootloader and mcuboot moving forward? Or are we planning to drop support for the ESP-IDF bootloader altogether? I would say we should probably support both, but would like to hear some input from others regarding this. |
I think there's some value in supporting at least two bootloaders, just to make sure the hal stays bootloader agnostic. |
+1 for keeping IDF bootloader support |
+1 for MCUboot, for a cross-platform option that I've heard is well placed to help with compliance towards the EU Cyber Resilience Act. |
Yes, let's close this. To finalize the thread, we will:
|
FWIW, there is a tool for field replacement of IDFboot with MCUboot, under development. "Rust" support still pending test. Once the Reflasher is downloaded by the current app running (as a 'normal' IDFboot-based update), it will normally replace current app with the reflasher, and in sequence the reflasher will replace itself and IDFboot with new bootloader and new application. More info: https://github.com/espressif/esp-self-reflasher |
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
mcuboot-rs
mcuboot-rs is a implementation of mcuboot, but in Rust. It is currently in PoC status.
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.
The text was updated successfully, but these errors were encountered: