Any general purpose retention register allotted for users?

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Any general purpose retention register allotted for users?

Postby hassan789 » Mon Jun 11, 2018 6:31 pm

I would like to track the number of crashes I see on my device and when it hits 100, fall back to factory mode, and do OTA. I would like to use a general purpose retention register to hold this fail_counter, this way it is accessible from boot-loader as well as app code. However ESP-IDF reserves some of these registers. Looks like one used internally is RTC_APB_FREQ_REG.

Other alternative, that I do not like:
-RTC ram seems to have some weird effects and crashes my app, if not used correctly.
-Custom linker into RTC ram -- complicated
-NVS too many P/E cycles

Easiest is GPRR. I wanted to know if there some registers specifically allotted for application-layer/users. Please advise which ones I can use (if any).

Thanks
:D


User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: Any general purpose retention register allotted for users?

Postby hassan789 » Mon Jun 11, 2018 10:07 pm

will try it

User avatar
hassan789
Posts: 156
Joined: Thu Jun 29, 2017 2:15 am

Re: Any general purpose retention register allotted for users?

Postby hassan789 » Tue Jun 12, 2018 5:18 pm

Unfortunately this does not work. Variables made in the bootloader that are cross-referenced in the app code, seem to be reset.

Resorting to custom linker...

Who is online

Users browsing this forum: No registered users and 200 guests