Hi dears,
I'm trying to reduce the power consumption of a custom board with a nRF5340 SoC. The application is a sensor node with an ADC and the BT support to transfer sampled data to a PC (server with BT support).
The Environment:
- nRFConnect SDK v2.2.0
- Zephyr OS
The application requirements are:
- The board provides an external Tuning Fork Crystal (32.768kHz) support to the SoC in order to permit the RTC use and/or a time reference.
- The SoC has to sleep all time (99.9% of the operating time). This need to be done by an Effective & Reliable Low Power Policy.
- One time/hour the SoC has to wake up to sample the analog entities by an external ADC.
- The SoC manages the external ADC by a SPI interface.
- The SoC transfers the sampled datas to a remote PC by the BT connection.
How can I implement that?
After the Optimizing Power on nRF5340 SoC Designs reading..
My understanding is:
- Modifiy the project.conf :
CONFIG_PM=y CONFIG_PM_DEVICE=yI don't know if that could be enough or I need of other configurations.
- include the headers for the PM control in the main.c
#include <zephyr/pm/pm.h>
#include <zephyr/pm/device.h>
#include <zephyr/pm/policy.h>
- Prevent from System OFF (no hardware support for the wakeup is present on board)
/* Prevent deep sleep (system off) from being entered */
pm_policy_state_lock_get(PM_STATE_SOFT_OFF);
- Use the pm_device_action_run() function or somenthing lika that to switch the PM states.
My dubt is: without hardware events how can I use a RTC (I have a 32kHz crystal on board) or timers to put the in Sleep the module and how to WakeUp it after a certain time?
Many Thanks for your support and have a nice day,
Best Regards