Skip to main content
asala.19
Associate III
Nov 6, 2020 7:31 AM UTC
Solved

How to read internal flash in stm32wb55

Hi,

i am working on stm32wb55 nucleo board.

I want to read data form one location of internal flash e.g 0x08047000 and write into the other location e.g 0x08007000.

i found there is HAL_FLASH_Program API available to write data into internal flash but i can't found any API for read data from flash memory.

Can you please help to how can i read data from the internal flash?

please provide me if any example code is available.

Regards,

Arjun

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 6, 2020 1:14 PM UTC

Access like you would other memory, use a pointer..

​

uint32_t *p = (uint32_t *)0x08047000;

​

p​rintf("%08X\n", *p);

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

6 replies

Remi QUINTIN
ST Technical Moderator
Nov 6, 2020 11:15 AM UTC

Not sure I understand the blocking point with your question

Did you have a look at the BLE-RfWithFlash project

C:\STM32Cube_FW_WB_VX.Y.Z\STM32Cube_FW_WB_V1.9.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_RfWithFlash

To read some flash memory area, you should define a variable pointing on the physical address to want to access. You can define this variable with a size covering the size of the area you want to read.

Flash memory can be read like a SRAM memory. no need for specific functions.

asala.19
asala.19Author
Associate III
Nov 6, 2020 1:27 PM UTC

thank you so much it's work:thumbs_up:

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Nov 6, 2020 1:14 PM UTC

Access like you would other memory, use a pointer..

​

uint32_t *p = (uint32_t *)0x08047000;

​

p​rintf("%08X\n", *p);

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
asala.19
asala.19Author
Associate III
Nov 6, 2020 1:27 PM UTC

thank you so much it's work:thumbs_up:

Remi QUINTIN
ST Technical Moderator
Nov 6, 2020 1:20 PM UTC

​Thanks Clive.

It is definitevely more explicit now!! :)