Skip to main content
rbenv.3
Associate III
March 22, 2019
Solved

cortex M4 writes to flash

  • March 22, 2019
  • 2 replies
  • 1032 views

With Cortex M0+ (BLE) running, how Cortex M4 writes data on flash ?

The reference manual says during flash writes all acess are denied.

This topic has been closed for replies.
Best answer by Christophe Arnal

​Hello,

When a flash write procedure is started, the flash is busy and no CPU ( either CM4 or CM0+) can fetch code or read data from the flash.

You may write data in flash on the CM4 side at any time. As the CM0+ may write data in flash as well, you shall first get Semaphore2 before writing in the flash and release it once you do not need anymore to write in the flash so that the CM0+ may write when needed its own data.

You may check as an example the BLE_Ota application where  the flash is written by the CM4 in the file otas_app.c

Regards.

2 replies

ST Employee
March 22, 2019

​Hello,

When a flash write procedure is started, the flash is busy and no CPU ( either CM4 or CM0+) can fetch code or read data from the flash.

You may write data in flash on the CM4 side at any time. As the CM0+ may write data in flash as well, you shall first get Semaphore2 before writing in the flash and release it once you do not need anymore to write in the flash so that the CM0+ may write when needed its own data.

You may check as an example the BLE_Ota application where  the flash is written by the CM4 in the file otas_app.c

Regards.

rbenv.3
rbenv.3Author
Associate III
March 22, 2019

Understood. Any write only stalls the entire flash.

Waiting publication of the semaphore allocation from the BLE side

Thank you Christophe