something about retention ram

8 posts / 0 new
Last post
lyncxy119
Offline
Last seen:1 year 10 months ago
加入:2015-05-14 03:23
something about retention ram

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:
summer20100514
Offline
Last seen:4 years 2 months ago
Guru
加入:2014-12-30 05:01
As far as I know, retention

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.

lyncxy119
Offline
Last seen:1 year 10 months ago
加入:2015-05-14 03:23
OK, thank you , so I should

OK, thank you , so I should find other ways to do it

MT_dialog
Offline
Last seen:5 days 21 hours ago
年代taff
加入:2015-06-08 11:34
Hi lyncxy119,

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

Joacimwe
Offline
Last seen:1 year 3 months ago
Guru
加入:2014-01-14 06:45
你的目的是什么

你的目的是什么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.

lyncxy119
Offline
Last seen:1 year 10 months ago
加入:2015-05-14 03:23
I want to keep a RTC value

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?

hardy.chen
Offline
Last seen:1 year 8 months ago
加入:2015-03-13 04:20
Hi,

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...).

MT_dialog
Offline
Last seen:5 days 21 hours ago
年代taff
加入:2015-06-08 11:34
Hi hardy.chen,

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