Zephyr RTC Alarm versus k_timer_start

Dear Customer Support,

Wanted to open a case to follow up on this old one Case ID: 335484  

 nRF52840 with Zephyr RTOS: How to use RTC with struct rtc_time? 

I initially looked at the counter alarm under

https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/counter/alarm/src

using rtc0 and counter_set_channel_alarm

Test environment nRF52840, but this seems to be pretty generic to any other nRF platform

I have few high level questions:

1-what would be the pros and cons of using the Zephyr counter alarm feature versus using the plain Zephyr k_timer_start with a registered callback?

2-with the counter alarm feature, there is an upper limitation on the alarm duration around 8 second, as obtained by

counter_get_top_value or counter_get_max_top_value

how to increase that maximum tick value to configure a higher duration value?

3-if we force the device into a power off state using sys_poweroff(), is there a possibility to wake up the device through an RTC callback

There is an available sample that shows how to wake up using a button press, so the idea is to replace the button by a RTC wake up

Thank you

Jamal

PS

I will have more follow up questions later...

Parents Reply
  • Hello Jamal,

    For both project I used nRF52840DK.

    Counter samples work ok and here is the output. 

    for rtc_api sample, I got assertion failed error. 

    For rtc_api , I am getting assertion failed error. The default value and when I change the value of RTC_TEST_GET_SET_TIME value.

    Could you please share your project (''I did not use the sample as is. I just integrated the piece of code highlighted above into my application running on a custom board using the nRF52840 chip.'') ? Did your modified sample work on our DK?

Children
Related