I am trying to optimize power consumption on our product which utilizes the NRF52840. I have found many great posts with recommendations to shut down UARTs, debug logging and so on. However, I am looking for ways to see what peripherals my project is using and enabling in the background.The NRF SDK and Zephyr solve a lot of problems, but also hide a lot of details. I am looking for help rolling back the curtain to understand what is happening underneath.
Here is what I have found so far, but am looking for suggestions and additional recommendations.
In Zephyr I am aware of the following configuration files which affect which peripherals are being enabled.
- prj.conf -- to level project configuration with "my" changes
- build/.config -- Generated during build listing every flag
- device tree -- Device tree defining hardware, such as nrf52840.dts
How do I relate the definitions here to hardware peripherals that are powered on? Some are obvious, but many are not. Is there a document that links the definitions and blocks in these files to hardware on the NRF52?
The Power Management Unit (PMU) is responsible for shutting down clocks and peripherals to save power. I have found some registers that indicate if the LDO or DC/DC converter is running, but am having trouble tracking much more down. Is there any way to extract information about what is active and in which state from this peripheral? Is there a driver available that I can to read this info out?
Is there any consistent method or set of registers across all the peripherals that software can use to read if each peripheral is on/off/sleeping etc? For example, is there some place I can read if the clock to each peripheral is enabled?
The system RAM is broken down into a large number of blocks and it seems they can be configured to retain state at different sleep/power states. How do I change this configuration? Is there a way to read out the state/configuration of each block?
Are there any other config files, peripherals or modules I can use to extract information on what is powered up in my device?
Thank you all,