Using RTC_CNTL_STOREx_REGs
Posted: Sat Sep 30, 2017 7:44 pm
Hi!
I need to store a very few of data during deepsleep and use minimal energy consumption as possible. I really don't like to use nvs storage for this, because it may exhaust erasing capacity of the flash chip.
My strategy is to power down all rtc domains during deepsleep and to use some of RTC_CNTL_STOREx_REGs to store my 2 words of data.
But from sources i see that all there RTC_CNTL_STOREx_REGs are occupied by data for the bootloader. I supposed to use only RTC_CNTL_STORE6_REG and RTC_CNTL_STORE7_REG for my data, because I am not going to use the deep sleep stub. But it looks like these registers are not under my control anyway: RTC_CNTL_STORE6_REG = 0 , RTC_CNTL_STORE7_REG = <some int> after every boot up.
After deep sleep I have 2 consequent resets on boot:
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
But any of these is not the System reset and then RTC registers shouldn't be reset. Probably I am mistaking...
My sources is release/2.1.
Please, show me the way))
Thanks in advance!!
I need to store a very few of data during deepsleep and use minimal energy consumption as possible. I really don't like to use nvs storage for this, because it may exhaust erasing capacity of the flash chip.
My strategy is to power down all rtc domains during deepsleep and to use some of RTC_CNTL_STOREx_REGs to store my 2 words of data.
But from sources i see that all there RTC_CNTL_STOREx_REGs are occupied by data for the bootloader. I supposed to use only RTC_CNTL_STORE6_REG and RTC_CNTL_STORE7_REG for my data, because I am not going to use the deep sleep stub. But it looks like these registers are not under my control anyway: RTC_CNTL_STORE6_REG = 0 , RTC_CNTL_STORE7_REG = <some int> after every boot up.
After deep sleep I have 2 consequent resets on boot:
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
But any of these is not the System reset and then RTC registers shouldn't be reset. Probably I am mistaking...
My sources is release/2.1.
Please, show me the way))
Thanks in advance!!