cancel
Showing results for 
Search instead for 
Did you mean: 

Save data in the flash

Kolab
Senior

Hello! I am trying to save the data that I receive through bluetooth in the 1M flash memory of the Nucleo board(STM32WB55). But when I call HAL_FLASH_Unlock() the program goes to HardFault_Handler function and stands in the while(1). Besides that there are many addresses that have question marks"??" what decreases the available memory for me. The start address to save to is 0x0800A000. Any idea how to make my board save properly?

7 REPLIES 7
Remi QUINTIN
ST Employee

Saving data in flash memori is already a topic covered in a fiew logs on the community:

See https://community.st.com/s/question/0D53W00000914bCSAQ/stm32wb-hsem-flash-semaphore-usage for example.

You can also have a look at the project under Application/BLE/BLE_RfWithFlash.

Dou you have a sreen shot of the ?? you get when reading the flash memory?

Kolab
Senior

0693W000001riQWQAY.png

Kolab
Senior

there is located the BLE stack:o

may be because of this

I didn't notice this

Remi QUINTIN
ST Employee

Yes as the BLE stack is protected againts any type of access as being located in a secure area.

All data above the SFSA pointeur is not accessible in clear.

Kolab
Senior

If I will want use the BLE_RfWithFlash with BLE_p2pclient there will be so much changes?

Remi QUINTIN
ST Employee

This is an example. Merging 2 examples is not a simple task I agree.

It is hard to help exactly with what you want.

Kolab
Senior

With my last comment I meant implementing Flash saving algoritm in a client profile, once BLE_RfWithFlash is writen upon BLE_p2p_server. But I could overcome this question: I just copied all that is linked to saving in flash (functions, ...) to my BLE_p2p_client project and called the needed functions in the file p2p_client_app and everything got ok.