Skip to main content
Akuma.6
Associate III
Feb 8, 2024 2:29 PM UTC
Question

Store data in internal flash using stm32g0x

Hi Team,

I am using stm32g0x mcu to store the default chunk of data in to internal specific location for our data storage. Once it reboot it should read the default data.

I tried with different mcu calls which will not synchronize with our platform.

Please share some examples based on our platform 

Regards,

Kumar 

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
Feb 8, 2024 3:23 PM UTC

Aren't there FLASH examples in HAL / CubeG0?

Find a sector/page at the end of memory.

Shrink the size assigned to FLASH in the linker script to account for your usage outside of application space.

Use a pointer to READ the content of a STRUCTURE holding your data / configuration. ie = (void *)0x08003F00, or wherever you've placed it.

Have some default settings you can write to the location if the structure integrity indicates it is wrong or empty.

Do the basic erase/write of the content of a RAM copy of the structure into the memory space you've selected.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
Feb 8, 2024 3:24 PM UTC
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Feb 8, 2024 3:23 PM UTC

The default chunk of data? What is this? The internal SRAM of STM32 usually survives reset, if the power is not lost. So after a reset you can expect data in the SRAM intact, without any special "calls".