On Tue, Nov 30, 2021 at 8:05 AM Fotis Panagiotopoulos <f.j.pa...@gmail.com> wrote:
> I found the issue. > > From the STM32F427 manual: > > > Any attempt to read the Flash memory on STM32F4xx while it is being > written or erased, > > causes the bus to stall. Read operations are processed correctly once the > program > > operation has completed. This means that code or data fetches cannot be > performed while > > a write/erase operation is ongoing. > > So, although there isn't any critical section anywhere, the CPU halts as it > cannot access the Flash memory. I think it may be necessary to put some parts of the NuttX kernel into RAM so that it can keep executing while the bus is stuck. I don't know off the top of my head whether we currently have a built-in way to do that. Nathan