You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
I am working on a project in which I am using ESP32s2.
The ULP_RISCV is utilized to read ADC data from the light sensor during deep sleep as shown here in ulp_main.c file.
raw_data = ulp_riscv_adc_read_channel(ADC_UNIT_1, ADC_CHANNEL_1);
/*if the new light_sensor value is greater than threshold A or lower than threshold B*/
if((500 > raw_data) || (2000 < raw_data))
{
/* set the prev_light_data to the previous reading */
prev_light_data = light_data;
light_data = raw_data ;
}
then we compare prev_light_data and light_data with specific threshold to decide whether to rise waking_flag or not.
The ULP will wake the main CPU when light sensor data exceeds a specific threshold.
The problem is when ULP finishes executing its code and goes to sleep (waiting for its next wake-up from the ULP-Timer), all ULP's global variables are re-initialized with different values than before sleeping.
So, how can I save the contents of ULP global variables so that when ULP goes to sleep and then wakes up (from the ULP-Timer) its global variables don't lose the contents/values that they were holding before sleep?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
ESP32s2 ULP-RISCV ADC in deep sleep the variable is loosing its value after ULP-RISCV sleep
ESP32s2 ULP-RISCV ADC in deep sleep the variable is loosing its value after ULP-RISCV sleep (IDFGH-9716)
Mar 24, 2023
All variables used by the ULP is placed in RTC memory and should keep their value even during sleep. I suspect your issue is actually related to something else.
There is an in-progress issue internally for a known problem with S2 ULP ADC in deep sleep related to some power configurations (it gives the wrong results when reading). I'll remind them that we still have users asking for support with this...
Answers checklist.
General issue report
I am working on a project in which I am using ESP32s2.
The ULP_RISCV is utilized to read ADC data from the light sensor during deep sleep as shown here in ulp_main.c file.
then we compare prev_light_data and light_data with specific threshold to decide whether to rise waking_flag or not.
The ULP will wake the main CPU when light sensor data exceeds a specific threshold.
Also, the ULP is working with the ULP timer.
here is the initiate of ulp in main.c file
The problem is when ULP finishes executing its code and goes to sleep (waiting for its next wake-up from the ULP-Timer), all ULP's global variables are re-initialized with different values than before sleeping.
So, how can I save the contents of ULP global variables so that when ULP goes to sleep and then wakes up (from the ULP-Timer) its global variables don't lose the contents/values that they were holding before sleep?
The text was updated successfully, but these errors were encountered: