Hello,
In the last week i've been struggling with the ULP usage. The project idea was to periodically wake up esp so he can send data over BLE and while in deep sleep, the ULP will monitor the adc input and if there's any significant change in the readings, it will immediately wake up and send the data. If there's any alteration in the ADC reading with ULP, the system works flawless. The problem is, if ESP wake up on time based, it never wakes up again with ADC reading.Can someone give me any hints on why is this happening?
Best regards,
Cant use ULP and timer wake up right
Re: Cant use ULP and timer wake up right
I struggled to get the ULP to behave myself.
Every time I restart the ULP and go into deep sleep, I call, in order,
ulp_run((&ulp_entry - RTC_SLOW_MEM) / sizeof(uint32_t));
esp_sleep_enable_ulp_wakeup();
esp_deep_sleep_start();
I'm guessing, and it is a guess, that you're lacking the middle call to esp_sleep_enable_ulp_wakeup() when you go back into deep sleep.
If you stop the ULP clock to prevent the ULP from running while the system is running, the ulp_run() will restart the clock. If either of these calls aren't made, I think you'd see the same symptom you seem to be describing.
Every time I restart the ULP and go into deep sleep, I call, in order,
ulp_run((&ulp_entry - RTC_SLOW_MEM) / sizeof(uint32_t));
esp_sleep_enable_ulp_wakeup();
esp_deep_sleep_start();
I'm guessing, and it is a guess, that you're lacking the middle call to esp_sleep_enable_ulp_wakeup() when you go back into deep sleep.
If you stop the ULP clock to prevent the ULP from running while the system is running, the ulp_run() will restart the clock. If either of these calls aren't made, I think you'd see the same symptom you seem to be describing.
-
- Posts: 4
- Joined: Thu Jan 23, 2020 5:48 pm
Re: Cant use ULP and timer wake up right
Ty for your answer,
I actually calling esp_sleep_enable_ulp_wake_up() and esp_deep_sleep() inside the ulp_sleep() function.
Recently I figured out that's some problem with the acquisition, but i still cant manage to properly wake up after a timer wake up.
The esp_sleep routine goes like this:
I actually calling esp_sleep_enable_ulp_wake_up() and esp_deep_sleep() inside the ulp_sleep() function.
Recently I figured out that's some problem with the acquisition, but i still cant manage to properly wake up after a timer wake up.
The esp_sleep routine goes like this:
Code: Select all
ESP_ERROR_CHECK( esp_sleep_enable_ulp_wakeup() );
esp_deep_sleep(45* 1000* 1000);
Re: Cant use ULP and timer wake up right
try this:
Code: Select all
esp_sleep_enable_timer_wakeup(us_time);
Who is online
Users browsing this forum: No registered users and 105 guests