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

ESP32-C3: Add support for booting from MCUboot bootloader #49

Merged
merged 4 commits into from
Oct 24, 2022

Conversation

gustavonihei
Copy link
Contributor

@gustavonihei gustavonihei commented Apr 12, 2022

Summary

This PR intends to enable an esp-hal-based Rust application to be booted from the MCUboot bootloader on ESP32-C3.

MCUboot is a secure bootloader solution feature-wise equivalent to the IDF 2nd stage bootloader (current default bootloader).
You may find more information on the documentation pages for MCUboot and the Espressif port:
https://docs.mcuboot.com/
https://docs.mcuboot.com/readme-espressif.html

Testing

Hello World example successfully executed from MCUboot bootloader on ESP32-C3-DevKitM-1 board according to instructions from the updated README.md file.

@gustavonihei gustavonihei force-pushed the feature/c3_mcuboot branch 6 times, most recently from 74b5338 to f2cea80 Compare August 22, 2022 22:01
@gustavonihei gustavonihei changed the title esp32c3: Add support for booting from MCUboot bootloader ESP32-C3: Add support for booting from MCUboot bootloader Aug 24, 2022
@gustavonihei gustavonihei marked this pull request as ready for review October 17, 2022 17:24
Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple small comments, otherwise as far as the code is concerned this looks fine to me. @bjoernQ would you mind taking a quick look as well please whenever you get a chance (if you haven't already)?

If you wouldn't mind it would also be nice for there to be a small section in the README briefly describing how to build and use this format. This isn't required, so if you're not feeling like doing it that's fine too, but would be appreciated!

esp32c3-hal/ld/mb-riscv-link.x Outdated Show resolved Hide resolved
esp32c3-hal/Cargo.toml Outdated Show resolved Hide resolved
@jessebraham
Copy link
Member

jessebraham commented Oct 21, 2022

Tested with the fixes to the linker script and everything is working as expected on my end, so once the review points have been addressed this should be good to merge!

@gustavonihei
Copy link
Contributor Author

gustavonihei commented Oct 24, 2022

If you wouldn't mind it would also be nice for there to be a small section in the README briefly describing how to build and use this format.

Done! Created a new section on the README.md file covering not only MCUboot, but also briefly describing about the other existing booting alternatives.

https://github.com/esp-rs/esp-hal/blob/1ced513d969b92419901c5e4b6bb95cec5bf4a7d/esp32c3-hal/README.md#supported-boot-methods

Previously it assumed that the entry point was allocated at the
beginning of the ".rwtext" output section, which is not always true.

Signed-off-by: Gustavo Henrique Nihei <[email protected]>
@gustavonihei gustavonihei force-pushed the feature/c3_mcuboot branch 3 times, most recently from bfee5ee to b68319e Compare October 24, 2022 13:09
Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README looks great, thanks! I think we're good to go here, so thank you again for your patience and your continued work on this feature, I look forward to expanding on it in the future!

@jessebraham jessebraham mentioned this pull request Sep 21, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants