cancel
Showing results for 
Search instead for 
Did you mean: 

cortex M4 writes to flash

rbenv.3
Associate II

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Christophe Arnal
ST Employee

​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.

View solution in original post

2 REPLIES 2
Christophe Arnal
ST Employee

​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
Associate II

Understood. Any write only stalls the entire flash.

Waiting publication of the semaphore allocation from the BLE side

Thank you Christophe