From c1b3c3e007d53fe3428562040a61da8b9352b557 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 8 May 2025 15:39:55 +0200 Subject: [PATCH 1/2] modules: hal_nordic: nrfx: Add GRTC clear at init feature Add option to clear GRTC conter value during driver initialization. Signed-off-by: Adam Kondraciuk --- modules/hal_nordic/nrfx/nrfx_kconfig.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index ef870a568b2b..3967864c88f1 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -182,6 +182,9 @@ #ifdef CONFIG_NRF_GRTC_START_SYSCOUNTER #define NRFX_GRTC_CONFIG_AUTOSTART 1 #endif +#ifdef CONFIG_NRF_GRTC_CLEAR_AT_INIT +#define NRFX_GRTC_CONFIG_CLEAR_AT_INIT 1 +#endif #ifdef CONFIG_NRFX_GPIOTE #define NRFX_GPIOTE_ENABLED 1 From 4c7866beb59a0fdce87c57598ec1ad504d535ba4 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Thu, 8 May 2025 15:46:02 +0200 Subject: [PATCH 2/2] drivers: timer: nrf_grtc_timer: Add GRTC clear at init feature Add option to clear GRTC conter value during driver initialization. Signed-off-by: Adam Kondraciuk --- drivers/timer/Kconfig.nrf_grtc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/timer/Kconfig.nrf_grtc b/drivers/timer/Kconfig.nrf_grtc index 082c15333dcb..a09243d7a78f 100644 --- a/drivers/timer/Kconfig.nrf_grtc +++ b/drivers/timer/Kconfig.nrf_grtc @@ -20,6 +20,11 @@ config NRF_GRTC_ALWAYS_ON help Always keep the SYSCOUNTER active even if the CPU is in sleep mode. +config NRF_GRTC_CLEAR_AT_INIT + bool "Clear the GRTC on driver init." + help + Clear the GRTC counter on initialization. + config NRF_GRTC_TIMER_APP_DEFINED_INIT bool "Application defines GRTC initialization" help