cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with flash in stm32wb55

IlliaGx
Associate III

Hello.
I found a problem with Flash. After successfully operating with flash before entering MX_APPE_Process(), the possibility of entering standby mode disappears. I had issues with the visibility of variable values after these operations, but I could say it was successful. I used standard functions to work with Flash. Something similar to what is in the examples for STM32WB.

Then I found this thread https://community.st.com/t5/stm32-mcus-wireless/stmwb55-flash-write-access-during-ble-connection/td-p/268121/page/3 where @Remi QUINTIN advised to use the Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE\BLE_RfWithFlash project, where I found a nice flash driver file.

I thought this should help to extinguish all conflicts in the sequencer and allow it to go into standby mode after using flash.

Below, I attach a project that has a demo of working with Flash and an algorithm for getting into standby, which was provided to me by the esteemed @FilipKremen.

I did not repeat all the functionality of the original application, but I took some elements from there. In particular, I put SHCI_C2_SetFlashActivityControl(FLASH_ACTIVITY_CONTROL_SEM7); in APP_BLE_Init.


If you run the FD_Wrapper_InitConfig(); function from the wrapper file in the part of initialization before the while(1) loop or from the rtc timer callback (in order not to enable tasks when the sequencer is not running yet), the task hangs somewhere here in the debugger:
line 308 if ((local_evtset & EvtWaited)== 0U) of function void UTIL_SEQ_Run( UTIL_SEQ_bm_t Mask_bm ). And it does not go further in the code.

If you run flash initialization before MX_APPE_Process(); without a debugger, the code goes further and lets you press the buttons, lighting up the LEDs. Only if you try to enter standby when pressing the SW1 button, it will go into a fault. If you start the flash init in the RTC callback, then nothing will happen, and the code will not reach the test run of the LED.

As far as I can see, it is the flash driver functions that are causing issues.

I would be extremely grateful for your help

 

 

 

2 REPLIES 2
IlliaGx
Associate III

If I run the write task through the sequencer, everything proceeds without errors; however, I still can't write the correct data to the flash.

IlliaGx
Associate III

It looks like I've got everything working fine. Sorry to bother everyone. Admins can delete my post. I'll check it all out and come back if there are any problems.