Hi dialog,
I define a variable in retention ram like this
uint32_t RTC_sec __attribute__((section("retention_mem_area0"),zero_init)); //@RETENTION MEMORY
when I sw reset the device , the RTC_sec was clean to 0, how to remain the value after I reset
Device:
As far as I know, retention memory only retains data during sleep, after you reset data is reset also. Maybe you'd better keep the data in external memory.
OK, thank you , so I should find other ways to do it
Hi lyncxy119,
Every time you reset the chip the retention RAM is zero initiated. You can use an external memory to store the data you want to preserve.
Please check thishttp://support.dialog-semiconductor.com/maintain-pairing-information
Thanks MT_dialog
你的目的是什么manually doing a software reset?
If you put your data in a section which has the UNINIT attribute in the scatter file, it will not be zeroed when you issue a software reset. However, when your memory is powered off it will be cleared and when it boots up again, there will be uninitialized random data in your variables.
I want to keep a RTC value generated by BLE timer ,but when the device sw reset, the RTC was cleaned, anyway else to do this?
Hi,
Yes, I also want to keep the time/tick information after platform reset 'platform_reset' (i.e. SUOTA activation).
年代o, according to comment from Joacimwe, I will try NOT to zero-initialize corresponding variables in the retention memory.
For dealing with the *random* data while it's not initialized during startup, there could be 2 options for this case:
1. checking the reset type, power on reset or others (i.e. watchdog, SW reset ... etc)
2. additional checksum for storing such time/tick information.
I'll try option 2 first, but would also like to have comment from Dialog team for option 1 (how to check reset type, but it seems to be impossible according to this threadhttp://support.dialog-semiconductor.com/how-could-i-know-whether-reset-c...).
Hi hardy.chen,
As i mentioned in the thread you ve posted there is no particular way to know from where the reset has occured. There is no particular register to indicate such an event.
Thanks MT_dialog