Page 1 of 1

Any general purpose retention register allotted for users?

Posted: Mon Jun 11, 2018 6:31 pm
by hassan789
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

Re: Any general purpose retention register allotted for users?

Posted: Mon Jun 11, 2018 7:53 pm
by WiFive

Re: Any general purpose retention register allotted for users?

Posted: Mon Jun 11, 2018 10:07 pm
by hassan789
will try it

Re: Any general purpose retention register allotted for users?

Posted: Tue Jun 12, 2018 5:18 pm
by hassan789
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...