2024-02-08 06:29 AM
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
2024-02-08 07:23 AM - edited 2024-02-08 07:23 AM
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.
2024-02-08 07:23 AM - edited 2024-02-08 07:24 AM
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".
2024-02-08 07:24 AM