Skip to main content
Jun 27, 2020 1:09 PM UTC
Question

Save data in the flash

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?

This topic has been closed for replies.

7 replies

Remi QUINTIN
ST Technical Moderator
Jun 29, 2020 9:30 AM UTC

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?

Jun 29, 2020 12:07 PM UTC

0693W000001riQWQAY.png

Jun 29, 2020 12:09 PM UTC

there is located the BLE stack:o

may be because of this

I didn't notice this

Remi QUINTIN
ST Technical Moderator
Jun 29, 2020 12:40 PM UTC

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.

Jun 29, 2020 12:43 PM UTC

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

Remi QUINTIN
ST Technical Moderator
Jul 1, 2020 10:25 AM UTC

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

It is hard to help exactly with what you want.

Jul 1, 2020 11:53 AM UTC

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.