RTC Boot (Slow Memory)
Posted: Mon Jun 26, 2023 1:11 am
The ESP32 TRM describes two RTC boot methods in 31.3.13. The second method, using RTC fast memory, is implemented in ESP-IDF (eg. esp_set_deep_sleep_wake_stub), however I can't find any references for the little-known first method. This uses RTC slow memory, and the TRM suggests that it might be a bit quicker:
I've confirmed that the stub entry is at 0x50000000, RTC slow memory is powered up, however all I'm getting is WDT resets. Interestingly, the stub even works correctly using the second method, despite not being in RTC fast mem.
Does anyone have any insight? Would any "initialization for C" actually be required here?
I've tried following the steps described with a simple stub setup like this:The first method is to use the RTC slow memory:
1. Set register RTC_CNTL_PROCPU_STAT_VECTOR_SEL for PRO_CPU (or register RTC_CNTL_APPCPU_STAT_VECTOR_for APP_CPU) to 0.
2. Put the chip into sleep.
3. When the CPU is powered up, the reset vector starts from 0x50000000, instead of 0x40000400. ROM
unpacking & SPI boot are not needed. The code in RTC memory has to do itself some initialization for the C
program environment.
Code: Select all
0x50000000: my_rtc_slow_stub // Very basic function to ensure entry is 0x50000000
call4 my_rtc_slow_stub_loop
0x50001000: my_rtc_slow_stub_loop
for(;;) REG_SET_PIN_LEVEL(rtc_pin_num, 1);
Does anyone have any insight? Would any "initialization for C" actually be required here?