Variable Store In Memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-07-16 11:27 AM
Hello
I want to update my variable continuously on Memory, so whenever bootup and power loss I can read that Value.
So which is the best way to store variable and read when MCU bootup.
- Labels:
-
STM32G0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-18 6:04 AM
Hello @AJeth.2,
The best option is to store your variable in the main flash because it's a non-volatile memory BUT
- In case of power on, the embedded flash memory automatically loads the option bytes. During the option bytes loading sequence, the device remains under reset and the embedded flash memory can’t be accessed. The values on the BOOT pin are latched on the 4th rising edge of SYSCLK after reset release and then the boot mode configuration is resolved.
- In case of power loss, the CPU is turned OFF and cannot access any memory... Do you want to read it with an external component ? However, 5 32-bit backup registers are retained in all low-power modes and also in VBAT mode. In fact, the backup registers (TAMP_BKPxR) are implemented in the RTC domain that
remains powered-on by VBAT when the VDD power is switched off.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-18 6:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-18 7:16 AM
If you have a battery backup for the RTC you can use the general purpose data registers (I believe there are 20 bytes in the G0 series) to save a few variables across resets and power loss.
Jack Peacock
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-18 8:08 AM
You've meant the Backup registers, I presume, TAMP_BKPxR.
JW
