Hello,
I'm trying to determine if my test results are accurate or deep-sleep code could be improved somehow.
Set-up:
Hardware: ESP32-C6, DFRobot DFR1075 FireBeetle2
Test equipment: Nordic Power profiler Kit II
Example: system/ulp/lp_core/gpio_intr_pulse_counter
IDF: v5.3.1
Problem:
during deep sleep phase the board consumes 1.3mA on average
Other deep-sleep example from DFRobot (ULP timer wakep) gives me power consumption of about 0.019mA.
It looks like that the biggest contributor to the power usage is ULP program running in a while(1) loop and ulp_lp_core_wait_for_intr() call.
I tried to isolate and/or reset all pins (ULP and/or GPIO) that are not being used for the interrupt. The power usage reduced by 1mA maybe, but that' all.
Can you confirm that what I'm seeing is about accurate power consumption given the specific example?
Is there anything in IDF I could use to reduce the power consumption for ULP programs handling interrupts?
Deep sleep ulp interrupt pulse counter high power consumption
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Deep sleep ulp interrupt pulse counter high power consumption
I would not be surprised if it is; the ULP and peripherals are still powered on.
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Deep sleep ulp interrupt pulse counter high power consumption
Waking up the ULP by LP IO, processing one edge of the signal, then halting the ULP again waiting for the next LP IO wakeup can save a lot of power; if the pulse frequency isn't too high.
Re: Deep sleep ulp interrupt pulse counter high power consumption
What exactly is that LP IO, isn't the interrupt already one of them?Waking up the ULP by LP IO
How I understand it is the signal on the pin is one half of waking-up process, the other half is ULP listening for that trigger so as to invoke the interrupt function. So it must be listening to handle the interrupts. The doc says the following (but the power draw still looks high):
void ulp_lp_core_wait_for_intr(void)
Puts the CPU into a wait state until an interrupt is triggered.
Note
The CPU will draw less power when in this state compared to actively running
Re: Deep sleep ulp interrupt pulse counter high power consumption
I found the example that demonstrates it: [lp_core_gpio_wake_up]examples/system/ulp/lp_core/gpio_wakeup/main/lp_core_gpio_wake_up_example_main.c[/url]; it works only with master (latest).Waking up the ULP by LP IO
Deep sleep consumption is around 0.02mA. Much better.
Thanks!
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Deep sleep ulp interrupt pulse counter high power consumption
Yeah, GPIO, LP IO... I just meant ULP_LP_CORE_WAKEUP_SOURCE_LP_IO.
I see it like this: If you already have a program running on the ULP doing <stuff>, you can use an IO interrupt to make the program also handle asynchronous IO events.How I understand it is the signal on the pin is one half of waking-up process, the other half is ULP listening for that trigger so as to invoke the interrupt function. So it must be listening to handle the interrupts.
If you want to only handle IO events, you don't need the interrupt; or put differently: int main (void) can be your "interrupt handler" handling the IO event(s) configured to wake up the ULP.
Having the ULP powered up but idle waiting for an interrupt is sure to consume more energy than shutting down (i.e. halting) the ULP.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 390 guests