Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

General • Problems with powman_enable_gpio_wakeup()

$
0
0
I am trying to implement powman low-power states for CircuitPython. While alarm based wakeups work fine, I have problems with wakeup from
GPIOs. To be more precise: the wakeup itself works fine, but the system has problems to reach the low-power state reliably.

This is a screenshot from my power-profiler (Nordic PPK2): I am running a short CircuitPython program that blinks a number of times and then
configures powman GPIO wakeup.
ppk2-powman-pinalarm.png
The problem is that the Pico2 often reaches the low power state only for a few ms, then it resets. But seemingly randomly it does reach the
low-power state and leaves it only after the configured GPIO-event.

In the example screenshot you see it needed four resets the first time, 12 resets the second time and two resets the third time. Note
that there are measurment artifacts in the image: the low spikes always reach the low power level, but due to the low sampling rate I
used for the PPK2 this is not visible.

The configuration of the GPIO does not seem relevant, I used all combinations of high/low and edge/level. In the example the GPIO is
tied to 3V3 and I verified with my scope that there is no glitch. Nothing else is connected to the device (except the PPK2 feeding power to
VSYS and GND).

What is adding to the mystery: after reset, I check the powman register LAST_SWCORE_PWRUP (powman_hw->last_swcore_pwrup). The register always has the value "2", which according to the docs is "pwrup1". But I am using powman_enable_gpio_wakeup(0,...) so I am expecting a "1" instead. I am also using powman_disable_all_wakeups() during setup so all gpio wakeup slots should be disabled.

From the coding side, I am basically using the code from
https://github.com/peterharperuk/pico-e ... ree/powman.

You can find my code at

Code:

 https://github.com/bablokb/circuitpython/blob/a6081f7874a181d78c4b43839f36b3ba6e032d45/ports/raspberrypi/common-hal/alarm/__init__.c
(lines 343ff and and 516ff)

and

Code:

https://github.com/bablokb/circuitpython/blob/a6081f7874a181d78c4b43839f36b3ba6e032d45/ports/raspberrypi/common-hal/alarm/pin/PinAlarm.c
(line 211ff)

Do you have any suggestions what to try next to track down the problem?

Statistics: Posted by bablokb — Mon Aug 04, 2025 11:17 am



Viewing all articles
Browse latest Browse all 8041

Trending Articles