Fundamental questions about ULP and wake up

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

Fundamental questions about ULP and wake up

Postby Zingemneire » Wed Jul 18, 2018 2:14 pm

Hi,

Lately i have been busy with integrating some ULP code and making that code wake up the main processor.
Until now it appears to be relatively straightforward but there are some things I am not 100% sure about.
First: a brief description of what my application needs to do:
  • On initial start up: transfer the ULP binary to RTC memory: that works 100%.
    use "ulp_run" to start the ULP code after having set it up to re-run every 15 seconds.
    Once it has run 20 times, and gathered 20 data samples, it wakes up the main processor and performs a ULP HALT operation.
    The main processor copies the 20 samples and stores it in a dedicated NVS partition.
The only thing I am not 100% sure about is that after copying and storing the samples the main processor uses "ulp_run" again to restart the ULP code after 15 seconds just after having set the timer register again to 15 seconds.
According to the documentation "ulp_run" starts the timer and after the specified time it will run the ULP code again.
That leads me to the following questions:
  • :?: As the ULP coprocessor's 15 second action always uses "halt" to make it sleep for the best part of 15 seconds and uses "wake" and "halt" once every 5 minutes to wake up the main processor and stop its own operation. Won't the ULP code automatically execute again after 15 seconds with or without the use of "ulp_run" by the main processor by that time?
    :?: is it possible that the ULP code is halted for as long as the main processor runs?
    :?: If it does happen again after 15 seconds while the main processor is performing some lengthy task which takes more than 5 minutes ( e.g.: an OTA update ) will it try to wake up the main processor?
    :?: If it does try and wakeup the main processor while it is still running what will happen then?
    :?: Will the main processor simply ignore the wake up attempt?
All in all it works well but I would like to be sure about the items above so that I could build in some refinements in case the main processor has to perform lengthy tasks.

Any help much appreciated.

ginodecock
Posts: 30
Joined: Thu Jun 29, 2017 7:10 pm

Re: Fundamental questions about ULP and wake up

Postby ginodecock » Sat Jul 21, 2018 11:48 am

Hi,

It is my understanding that the ulp runs independently of the main cpu.

However I found that an ulp wakeup can interfere with the deepsleep wakeup timer.

Who is online

Users browsing this forum: No registered users and 94 guests