embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.67k stars 791 forks source link

Flash interrupt with STM32F7 only triggering once #775

Open dpl0 opened 2 years ago

dpl0 commented 2 years ago

Hi everyone!

We're trying to set up an interrupt for flash programming with a Nucleo-f767zi, to be triggered when when the flash has finished writing (the BSY bit is cleared). So far we've managed to make it work, but it only triggers once.

For now, we're trying the following:

We know the interrupt is triggered because we are checking via a print.

Is there something we're missing? All the help is appreciated. Thanks for the help!!

chemicstry commented 2 years ago

I'm not sure if still relevant, but you could check my PR for F4 async flash: https://github.com/embassy-rs/embassy/pull/870

I remember having similar behavior as yours, when I had separate enable_irq() and disable_irq() functions, which set the EOPIE and ERRIE bits. Once I moved them together with with setting PG bit the problem disappeared. It could have been just a coincidence, but worth checking.