Hi everyone,
I've been developing an application using the nRF7002DK, where the nRF5340 SoC communicates with the nRF7002 SoC to connect to a Wi-Fi network, retrieve a JSON object via an HTTP GET request, and execute some tasks before entering sleep mode. This entire process — connecting to Wi-Fi, fetching the JSON, parsing it, and performing the required tasks — is working as expected.
Now, I want to significantly improve power consumption. Since the application only needs to run once per day, I would like to use the RTC (Real-Time Counter) peripheral as a wake-up source every 24 hours. According to the nRF5340 SoC RTC peripheral datasheet, it seems possible to achieve this using the prescaler values.
Additionally, I want to use a button (sw0) on the nRF7002DK to manually wake up the nRF5340 SoC and force the application to run, even if 24 hours haven't passed yet.
1. GPIO as Wake-Up Source:
- I checked a Zephyr sample but couldn't find where sw0 is explicitly configured as a wake-up source.
- Is it necessary to configure the GPIO pin explicitly in the device tree or the code, or are all GPIOs wake-up sources by default?
2. RTC peripheral as Wake-up Source:
- If Zephyr aims to be a generic and modular framework for different vendors, why does the sample use a Nordic-specific include for the RTC peripheral?
#include <zephyr/drivers/timer/nrf_grtc_timer.h>
The only examples I find online, including in this forum, typically use the nrfx HAL. Are we forced to use nrfx HAL for this purpose, even though the official SDK for Nordic SoCs is the Zephyr SDK?
3. Confusing Documentation:
- For instance, I found an example for GPIO as a wake-up source, but the source code uses STM HALs, and the 'west build' command targets a Nucleo board, even though the page refers to an nRF54H20 SoC. Why some Nordic documentation references other vendors’ SoCs (e.g., STM) in examples related to wake-up sources? Is this just an oversight in the documentation, or is there a reason behind it?
Any recommendations or insights on how to properly configure RTC and GPIO as wake-up sources in Zephyr for nRF52x, nRF53x and nRF54x SoC?
Thanks in advance!