@@ -426,8 +426,12 @@ int z_nrf_grtc_wakeup_prepare(uint64_t wake_time_us)
426426 nrfy_grtc_timeout_get (NRF_GRTC ) * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / 32768 +
427427 MAX_CC_LATCH_WAIT_TIME_US ;
428428 k_busy_wait (wait_time );
429- #if DT_NODE_HAS_STATUS (DT_NODELABEL (lfxo ), okay ) && NRF_GRTC_HAS_CLKSEL
429+ #if NRF_GRTC_HAS_CLKSEL
430+ #if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC )
431+ nrfx_grtc_clock_source_set (NRF_GRTC_CLKSEL_LFLPRC );
432+ #elif DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (lfxo ))
430433 nrfx_grtc_clock_source_set (NRF_GRTC_CLKSEL_LFXO );
434+ #endif
431435#endif
432436 k_spin_unlock (& lock , key );
433437 return 0 ;
@@ -501,11 +505,15 @@ static int sys_clock_driver_init(void)
501505 z_nrf_clock_control_lf_on (mode );
502506#endif
503507
504- #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT ) && \
505- DT_NODE_HAS_STATUS (DT_NODELABEL (lfxo ), okay ) && NRF_GRTC_HAS_CLKSEL
508+ #if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT ) && NRF_GRTC_HAS_CLKSEL
509+ #if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC )
510+ /* Switch to LFPRC as the low-frequency clock source. */
511+ nrfx_grtc_clock_source_set (NRF_GRTC_CLKSEL_LFLPRC );
512+ #elif DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (lfxo ))
506513 /* Switch to LFXO as the low-frequency clock source. */
507514 nrfx_grtc_clock_source_set (NRF_GRTC_CLKSEL_LFXO );
508515#endif
516+ #endif
509517
510518#if defined(CONFIG_NRF_GRTC_ALWAYS_ON )
511519 nrfx_grtc_active_request_set (true);
0 commit comments