NRF54L15 GRTC SYSCOUNTER

Hi Dev,

Development platform: NRF54L15 + NCS 3.2.3.
We are using the GRTC SYSCOUNTER as a system timestamp. Under normal conditions, a software reset does not clear the GRTC counter value.

However, after long-term operation, we occasionally observe that the SYSCONTER becomes zero after a reset, causing the system timestamp to roll back.

Could you please clarify:

1. Under which reset conditions is the SYSCONTER cleared, and under which conditions is it preserved?

2. How can we prevent the SYSCOUNTER from being cleared across resets (or recover the timestamp reliably if clearing is unavoidable)?

Thanks,
Chen

Parents
  • It seems possible that the nrfx_grtc_timer has an issue in how it handles the soft reset (CTRL-AP reset)

    sys_reboot->sys_clock_disable()->nrf_grtc_timer.c:sys_clock_disable()->nrfx_grtc_uninit->

    #if NRFY_GRTC_HAS_EXTENDED && NRFX_IS_ENABLED(NRFX_GRTC_CONFIG_AUTOSTART)
        nrfy_grtc_sys_counter_auto_mode_set(NRF_GRTC, false);
        nrfy_grtc_sys_counter_set(NRF_GRTC, false);
        nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_STOP);
        nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_CLEAR);
    #endif // NRFY_GRTC_HAS_EXTENDED && NRFX_IS_ENABLED(NRFX_GRTC_CONFIG_AUTOSTART)

    It looks like NRFX_GRTC_CONFIG_AUTOSTART is the reason here as if it is set to 1 then nrfx_grtc stops and clears the GRTC counters

    try setting CONFIG_NRF_GRTC_START_SYSCOUNTER=n in your prj.conf and make sure you start the syscounter in app and see if your issue goes away.

Reply
  • It seems possible that the nrfx_grtc_timer has an issue in how it handles the soft reset (CTRL-AP reset)

    sys_reboot->sys_clock_disable()->nrf_grtc_timer.c:sys_clock_disable()->nrfx_grtc_uninit->

    #if NRFY_GRTC_HAS_EXTENDED && NRFX_IS_ENABLED(NRFX_GRTC_CONFIG_AUTOSTART)
        nrfy_grtc_sys_counter_auto_mode_set(NRF_GRTC, false);
        nrfy_grtc_sys_counter_set(NRF_GRTC, false);
        nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_STOP);
        nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_CLEAR);
    #endif // NRFY_GRTC_HAS_EXTENDED && NRFX_IS_ENABLED(NRFX_GRTC_CONFIG_AUTOSTART)

    It looks like NRFX_GRTC_CONFIG_AUTOSTART is the reason here as if it is set to 1 then nrfx_grtc stops and clears the GRTC counters

    try setting CONFIG_NRF_GRTC_START_SYSCOUNTER=n in your prj.conf and make sure you start the syscounter in app and see if your issue goes away.

Children
No Data
Related