I am experimenting with the ULP processor.
A simple hart beat LED blinking program is reliable (it runs for days), but a more complex program (bit-banging the DHT-11/22 protocol)
stops after a random period, eg 30 successful read outs.
I inspected with a scope and there is no issue with the DHT-22 communication. Also reading the internal temperature sensor (this code is much simpler) stops after a while.
The source is here:
https://gist.github.com/tomtor/99e2a33b ... 94fc0df804
Any hints about the potential cause would be much appreciated!
EDIT:
I can prevent the hang by keeping the ULP program running (remove the I_END()).
In the original version the ULP program executes I_END() and wakes the main processor from deep sleep.
The main processor restarts the ULP program with ulp_run(0).
So either sometimes a wakeup fails or the ulp_run() fails to start the ULP program. I expect some race condition.
Complex ULP programs (DHT-22 protocol) hang after a while
Re: Complex ULP programs (DHT-22 protocol) hang after a while
Perhaps related:
Switching timer register, eg
only works when setting the power domain:
In the default setting register 0 remains active!
Switching timer register, eg
Code: Select all
I_SLEEP_CYCLE_SEL(1)
Code: Select all
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
Who is online
Users browsing this forum: aliarifat794 and 66 guests