cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting flash memory breaks BLE connection on STM32WB50

EnricoMosconi
Associate

I am using a STM32WB50CGU5, when erasing flash memory where my settings are stored, the BLE connection breaks. It happens even if I erase only one page (number 96).

I think the two CPU conflicts doing flash operations, but the datasheet reports:

"The embedded Flash memory is shared between CPU1 and CPU2 on a time sharing basis. A dedicated HW mechanism allows both CPUs to perform Write/Erase operations."

What can I do to fix this problem?

Is it a BLE stack problem?

1 REPLY 1
Remi QUINTIN
ST Employee

The Flash memory is a shared resource protected by 2 semaphores. A core must get the 2 semaphores before performing any data accesses.

those accesses are quite time critical as M0+ core running the RF stack has very tight real time constraints.

If the M4 core is performing even a single block erase at the wrong timing, it could disturb the RF stack so much that the BLE connection is lost.

I would recommend you look at the project under C:\STM32Cube_FW_WB_VX.Y.Z\STM32Cube_FW_WB_V1.8.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_RfWithFlash

This example is to demonstrate the capability to erase/write the flash while a Point-to-Point communication using BLE component is active.