ESP32-S2-DevKit-Lipo-USB RTC not working

Started by findmyname, June 11, 2021, 03:26:27 pm

Previous topic - Next topic

findmyname

Hi everybody,

I'm trying to store var in RTC slow memory but after deep sleep the variable has always default value. I'm kind of lost. Used board ESP32-S2-DevKit-Lipo-USB and framework ESP-IDF.

I define var at the begging of the program:

RTC_DATA_ATTR static int bat_v_rtc;
I increment the var just for the test in the main code:
bat_v_rtc++;
I also print it before and after increment operation.

I enter DS, I also explicitly activate RTC slow memory:

    esp_wifi_stop();
    ESP_ERROR_CHECK( esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON) );
    esp_deep_sleep(sleep_interval)

When the VAR is printed when the board is up again the VAR has default value 0.
Do you know what can be wrong ?

Also this esp-idf example always prints boot count: 1.

Do you know guys if RTC should work for this board ?

Thx

JohnS

Maybe print the address of the thing(s) with RTC_DATA_ATTR to see if they have actually been put in the right place.

May be a software issue that they are not in there!

John

findmyname

Quote from: JohnS on June 12, 2021, 12:31:04 pmMaybe print the address of the thing(s) with RTC_DATA_ATTR to see if they have actually been put in the right place.

May be a software issue that they are not in there!

John

Hi John,

The value of pointer is 0x50000014.

BR

JohnS

June 14, 2021, 01:47:54 am #3 Last Edit: June 14, 2021, 01:49:38 am by JohnS
And what does the datasheet say for the memory area you want it in?

Then if it's in the right area I guess you look how (if at all) it needs powering and/or configuring.

John

findmyname

Quote from: JohnS on June 14, 2021, 01:47:54 amAnd what does the datasheet say for the memory area you want it in?

Then if it's in the right area I guess you look how (if at all) it needs powering and/or configuring.

John

Hi John,

Thanks for your advice.
I looked on the esp32-s2 DOC and it seems that RTC SLOW memory starts at 0x50000000.
1)
```
The "Mem" written is the RTC_SLOW_MEM memory. Address 0, as seen by the ULP coprocessor,corresponds to address 0x50000000, as seen by the main C
```
2)
```
The program is stored in a dedicated region called Slow Memory, which is visible to the main CPU as one that has an address range of0x5000_0000 to 0x5000_1FFF (8 KB).
```

JohnS

That looks OK.

Is the ULP enabled? It looks not to be, by default.

John