Page 2 of 2

Re: Save data on power down

Posted: Fri Jan 04, 2019 3:25 pm
by Philosophix
I was accidentally looking at the PYB1.0 picture in the quick reference where there is no VBACK. I have PYB1.1 so after getting the correct picture I added a CR2032 to VBACK and which is working fine with the code you provided. I still can't find any documentation on the stm-module.

Re: Save data on power down

Posted: Fri Jan 04, 2019 4:59 pm
by Roberthh
I was sure it existed in the docs. But it is in the Wiki: http://wiki.micropython.org/platforms/b ... ard/modstm

Re: Save data on power down

Posted: Thu Jan 10, 2019 7:10 am
by Philosophix
Saving a number to stm.mem32[stm.RTC+stm.RTC_BKP9R] on power down is working fine, but I need to save another number too which can fit in 16 bits. Is there room for another number and if so, what is the address?

The Wiki: http://wiki.micropython.org/platforms/b ... ard/modstm won't let me access http://wiki.micropython.org/platforms/b ... -const-rtc. It's asking me to sign in so I could not check the documentation.

Re: Save data on power down

Posted: Thu Jan 10, 2019 9:20 am
by pythoncoder
The battery backed RAM is 4KiB of contiguous space. You'll find some tips on accessing it here.

Re: Save data on power down

Posted: Thu Jan 10, 2019 10:53 am
by chuckbook
So far MicroPython uses only two of the RTC 32-bit backup registers available (20 on Pyboard, 32 on PYBD).
On a PYBV11 BKP1R..BKB18R are available for general usage.Keeping data inside RTC avoids powering backup RAM.