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

Using embassy-boot on esp architectures #2944

Open
Sycrosity opened this issue May 15, 2024 · 2 comments
Open

Using embassy-boot on esp architectures #2944

Sycrosity opened this issue May 15, 2024 · 2 comments

Comments

@Sycrosity
Copy link

As there is to my knowledge not an available DFU bootloader on esp for no_std applications, I've been attempting to implement embassy-boot for ESP architectures, attempting to copy the layout of the embassy-boot-* crates - however, the way that the embassy-boot-* crates Bootloader::load() functions work (which load the application thats in the "active" partition from what I can understand) uses cortex_m functions which are (at least from my searching) not available in the xtensa and riscv crates. How could I go about implementing this (or finding out how to implement it) for esp platforms?

@lulf
Copy link
Member

lulf commented May 15, 2024

I don't know the esp hal, but some searching through esp-hal I think I found some reset functions here https://github.com/esp-rs/esp-hal/blob/9edd098da56be11dde2ba7cd8ecffaaea23cb030/esp-hal/src/reset.rs#L106-L124

So the idea would be to replace the cortex-m bits with something like the above. Maybe @MabezDev can provide confirmation or additional info about reset.

@Sycrosity
Copy link
Author

Thank you for those! With some more tinkering, I have replaced the WatchdogFlash section of the bootloader, with suitable esp replacements (esp-storage is very useful for this) - however I still am not sure on the rest of the loading step (as before using the reset commands you have to modify the stack pointer). xtensa_lx::set_stack_pointer and xtensa_lx::set_vecbase seem like they could be helpful? (https://docs.rs/xtensa-lx/0.9.0/xtensa_lx/)

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

No branches or pull requests

2 participants