Open HomeACcessoryKid opened 1 year ago
Hi,
This is actually as intended. C2 doesnt have any RTC memory, so this kconfig option is disabled. (You can actually see its dependency in kconfig depends on SOC_RTC_FAST_MEM_SUPPORTED
)
If C2 doesn't have any RTC, then the documentation of this feature must be made a lot clearer.
Based on that documentation I decided to raise this bug.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#config-bootloader-custom-reserve-rtc
Considering that you have dynamic documentation per platform, then you have to make the conclusion clear:
There is no RTC on a C2. Just write it down.
Having said that, is there an alternative (short of abusing flash memory) to transfer information across a powered reset?
As always, thanks for the wonderful development platform that the ESP is!
Point taken about the docs, I'll make a ticket for it and see if it is somehow possible for us filter out these options that will always be false.
Regarding other options, there are the RTC_CNTL_STOREX_REG
registers, but I'm afraid these are used for internal IDF stuff, so I cant recommend you to use these.
So NVS is the only "good" suggestion I can think of.
Clear answer, thank you.
Having said that, and considering that the CUSTOM_RTC feature was able to address 16 bytes only anyhow, is it not possible to carve out 16 bytes out of this RTC_CNTL_STOREX_REG space? Or even 4? Not that I know what that implies, but 16 seems a very small number, right? Because you rightfully wrote "good" when referring to flash. Let alone that NVS is hard (if at all) to use sending info from or to the bootloader.
You can see what these registers are used for here. It doesn't look like any of them are likely to available for users, but maybe there are some circumstances where we could free up one or two of them. I'm not that familiar with the details of the RTC related code, but i'll poke the guys responsible for this and ask them.
CUSTOM_RTC feature was able to address 16 bytes only anyhow
We actually recently fixed this (as you implied, this size limit was pretty arbitrary... ), so you are now free to use as much RTC memory as you want for this.
Asked around and unfortunately it doesnt seem like we'll be able to release any of these registers for end-user use-cases.
Hi Marius, Picking this up again with a new idea. Upon reading the code for the registers, I think that there is a lot of free namespace for the RESET_REASON definitions. So, with a 15 bit space (with the half-word and top bit stuff), the definitions could go as high as 32767, right? So plenty of space.
It would be nice if there would be an extension of the esp_restart(void) function where a parameter is given to indicate a reboot from another ota partition than the current selected one. We know that RTC_SW_CPU_RESET is encoded as 12.
Simple encoding could be done with a value of 28 (12+16) to indicate RTC_SW_CPU_RESET_OTA1 instead of RTC_SW_CPU_RESET. Or, to cover all ota definitions and also factory reset you could assign 28 to factory and 32-47 to OTA0-OTA15
Other ideas can valid as well, but with plenty of space, these could be valuable functions.
Thanks for your attention...
Answers checklist.
IDF version.
v5.0
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
What is the expected behavior?
support for
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
in ESP32-C2What is the actual behavior?
It is missing as an option from
idf.py menuconfig
when compiling code that works fine on other platforms, this is the essential hint that it is missing:
Steps to reproduce.
idf.py app
Build or installation Logs.
More Information.
Using Docker container v5.0 but inspected source of master branch
When looking for
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
it is clear that ESP32-C2 is forgotten somehow.