Complex ULP programs (DHT-22 protocol) hang after a while

tomtor
Posts: 22
Joined: Thu May 11, 2017 6:15 am

Complex ULP programs (DHT-22 protocol) hang after a while

Postby tomtor » Fri Sep 29, 2017 6:48 pm

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.

tomtor
Posts: 22
Joined: Thu May 11, 2017 6:15 am

Re: Complex ULP programs (DHT-22 protocol) hang after a while

Postby tomtor » Sat Oct 07, 2017 12:50 pm

Perhaps related:

Switching timer register, eg

Code: Select all

I_SLEEP_CYCLE_SEL(1)
only works when setting the power domain:

Code: Select all

esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
In the default setting register 0 remains active!

Who is online

Users browsing this forum: No registered users and 96 guests