This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Self-monitoring nrf52 peripherals to ensure long battery life

Hi
I am building a software watchdog to monitor nrf52 peripheral states to have higher confidence for 10+ years battery lifetime.
The idea is to check every few seconds if peripherals are in idle state. There would be a timeout that is reset every time the peripheral is not draining battery.

I am using BLE NUS, NFC, SPI, UART, SAADC, 

Out of my used peripherals these are easy to monitor: gpio pin states (leds and many other externals), HFCLK source (not) being HFXO (should catch nfc errors - there have been some), saadc status. 

Checking some of the peripherals is complicated since e.g. idle spi NRF_SPI0->ENABLE is always 1 after being initialised (and communicated with) using sdk's api (still having proper power consumptions). On hardware level there are started and stopped events but these are cleared by sdk.

I assume that the main consumption indicator is HFCLK - most peripherals need it and if uart, timer or some other peripheral is accidentally left running it will keep the clock running even during sleep. Most peripherals dont request for HFXO - thus checking if HFCLK source is HFXO only covers few peripherals (nrf radio, nfc).

The problem is that I can't check from the code if HFCLK is stopped during sleeping since when mcu wakes up it starts HFCLK too to execute code.

I am grateful for any ideas around self-monitoring nrf's power consumption.

Using nrf52832, SES 4.40.

  • Hi

    I'm sorry, but we don't have a way to check if the HFCLK is stopped during sleep. You'll just have to make sure that the application is uninitializing these "complicated" peripherals correctly so that the HFCLK does turn off correctly every time you go to sleep. The only way would be to actually measure the current consumption, which I understand is not very relevant here.

    Best regards,

    Simon

Related