Project-CETI / whale-tag-recovery

APRS and Swarm satellite based GPS tracking for tags
5 stars 4 forks source link

Sleep µCU when not being used #4

Open SSModelGit opened 2 years ago

SSModelGit commented 2 years ago

Assuming no RX of APRS messages, we want to leverage the sleep capabilities of the RP2040 so that we are using as little power as possible. Ideally, we use a timer to set when the chip should wake up, and at all other times it hibernates at the lowest power mode.

kellyostrom commented 2 years ago

This requires fixing an IRQ usage issue on the RP2040, currently when waking from the sleep it will eventually kernel panic for running out of available user IRQs. The lowlevel internal call for restoring the gpio IRQ after the sleep does not appear to be freeing properly, will need more investigation before this can be fully implemented in a way that rewakes the RP2040.

msalinoh commented 8 months ago

Implementing low power mode is still relevant to STM32 based board.

Sources to wakeup during idle state: 1) receiving UART command from host board 1) critical battery voltage (switch to shutdown state) 1) WDT, failure to receive communication from host board in 10 minutes (switch to active state)

Sources to wakeup during active state: 1) transmit timer 1) receiving UART command from host board 1) receiving UART from GPS chip 1) critical battery voltage (switch to shutdown state)

Updated issue title