cancel
Showing results for 
Search instead for 
Did you mean: 

How to read internal flash in stm32wb55

asala.19
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6
Remi QUINTIN
ST Employee

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.

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
Up vote any posts that you find helpful, it shows what's working..
Remi QUINTIN
ST Employee

​Thanks Clive.

It is definitevely more explicit now!! :)

thank you so much it's work:thumbs_up:

thank you so much it's work:thumbs_up:

Can it work in byte access mode?