Flash programming in HALs

I am a maintainer for MCUboot, which is a (currently) C bootloader for microcontrollers. I am starting to investigate writing an MCUbootloader in Rust, based off of what we do now.

Looking into a few HALs, I'm finding that most are missing support for the Flash controllers. Flash controllers are usually tricky, because it isn't possible to execute code out of flash while programming it. Typically, code will be placed in RAM, and executed there, with interrupts masked.

I'm interested in whether anyone has worked on flash drivers, and/or if there are any pointers on possible work done on linker script magic that would be needed to have certain functions execute out of RAM.


If you don't get any answers here, I would recommend asking on the embedded Rust Matrix channel. I find it to be far more active than URLO for embedded work.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.