Mr Jared, I am sorry.
I accidentally pressed the verify button and the ticket(Case ID: 288462) was closed.
To answer your earlier question.
I checked the nrf_drv_rtc_cc_set() error code. It was '0x0000000d'.
Can you give us an idea of the solution?
Mr Jared, I am sorry.
I accidentally pressed the verify button and the ticket(Case ID: 288462) was closed.
To answer your earlier question.
I checked the nrf_drv_rtc_cc_set() error code. It was '0x0000000d'.
Can you give us an idea of the solution?
Hi,
Are you sure that it returns that?
The nrf_drv_rtc_cc_set() should either return NRFX_SUCCESS or NRFX_ERROR_TIMEOUT
Can you share a screenshot that shows the error code?
regards
Jared
Thank you for your prompt reply.
I read the err_code in debug mode in SEEGER as attached.
I am using the breakpoint 'APP_ERROR_CHECK(err_code)' just after nrf_drv_rtc_cc_set() and reading the err_code there.
I don't know any other way to read the err_code other than this way.

Hi,
I'm sorry I was reading the wrong error register. The error that you're getting is indeed NRFX_ERROR_TIMEOUT.
NRFX_ERROR_TIMEOUT: The compare is not set because the request value is behind the current counter value. This error can only be reported if the reliable mode is enabled.
It seems like the RTC peripheral isn't able to clear the counter before you call nrf_drv_rtc_cc_set().
Could you use the second solution I provided in the original thread?
regards
Jared
Thanks for your reply.
'It seems that the RTC peripheral cannot clear the counter before calling nrf_drv_rtc_cc_set()'.
Indeed, when debugging, it seemed to work fine when the program was run one step at a time.' It might work if you put a delay time between 'nrf_drv_rtc_counter_clear( )' and 'nrf_drv_rtc_cc_se( )', but I have not tried that.
I would like to apply the second solution you suggested.
Thanks for your reply.
'It seems that the RTC peripheral cannot clear the counter before calling nrf_drv_rtc_cc_set()'.
Indeed, when debugging, it seemed to work fine when the program was run one step at a time.' It might work if you put a delay time between 'nrf_drv_rtc_counter_clear( )' and 'nrf_drv_rtc_cc_se( )', but I have not tried that.
I would like to apply the second solution you suggested.
Hi,
Great, I'll mark this case as closed then.
best regards
Jared