ULP ADC read fails #11599
Replies: 6 comments 5 replies
-
To clarify, the indication of the ULP getting "stuck" is that the "start" and "wake" counters are not increasing as expected. See them getting the value of 2 at the point the device woke due to a timer. So just 2 invocations of the ULP program in 20 seconds. |
Beta Was this translation helpful? Give feedback.
-
I don't see the settings |
Beta Was this translation helpful? Give feedback.
-
There are no such settings in this project. You are probably confusing this with the "ulp_adc" example in ESP-IDF SDK. This POC is somewhat based on that code but the ULP program is different. It is ULP MACROs instead of ULP assembly, so there are no "c variables". You have 4 settings in RTC_SLOW_MEM. See:
I couldn't find a way to run the ESP-IDF ulp_adc example as-is on Arduino. |
Beta Was this translation helpful? Give feedback.
-
I do understand this but the values 1500 and 2000 are nowhere applied in your code. I think the are needed, because the are there in IDF example. |
Beta Was this translation helpful? Give feedback.
-
Those thresholds are used in another project where the ULP code compares the ADC reading with the thresholds. In the POC of this issue the value of the ADC is not used nor compared with anything. This reproduce code is a different ulp program than the one in ulp_adc. |
Beta Was this translation helpful? Give feedback.
-
@ayavilevich - This is not an Arduino issue. It is about ULP ASM and how to implement a specific project. I'll move it to discussion. I think that the ULP has never completed running the ASM code. But I didn't try out the project, just took a quick look. You can check this example from Arduino to see how the ESP32 ULP is used (maybe already done it?) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Board
ESP32 generic dev module
Device Description
ESP32 generic dev module. Nothing additional connected.
Hardware Configuration
Nothing additional connected.
Version
latest stable Release (if not listed below)
IDE Name
Arduino IDE 2.3.6 and Platform.IO on VSC
Operating System
Windows 10
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
921600
Description
Since Arduino-ESP32 2.0.14, using an ADC read operation in ESP32 ULP FSM co processor will cause the ULP to get "stuck".
I am including minimal code to reproduce.
Expected: wake due to an ULP wake after 5 seconds.
Actual: wakes due to (a fallback) timer wake after 20 seconds.
If using this code with ESP-IDF directly then it works as expected.
If using this code in a version before 2.0.14, then it works as expected.
If disabling the ADC read operation in the ULP code, then it works as expected.
More details at https://github.com/ayavilevich/ulp_adc_issue_ard_min/blob/main/README.md
Sketch
Debug Message
Other Steps to Reproduce
also tried on another ESP32 board. it made no difference.
I have checked existing issues, online documentation and the Troubleshooting Guide
Beta Was this translation helpful? Give feedback.
All reactions