Nordic Team,
I have a question regarding RTC1 with regards to app_timer2.c
My Setup:
nRF52833 - PCA10100 Development Board
nRF SDK v17.1.0
s140_nrf52_7.2.0
What am I trying to achieve?
Get both UARTs on the nRF52833 working using libuarte . I did get this successfully working, I took the libuarte example for the PCA10056 and made an example for PCA10100. Then I added the second libuarte . Ultimately, I will add BLE peripheral mode to this product which is why I am also using Softdevice S140 v7.2.0.
What does the configuration look like?
I configured both LibUARTe configurations as follows:
NRF_LIBUARTE_ASYNC_DEFINE(libuarte_0, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
NRF_LIBUARTE_ASYNC_DEFINE(libuarte_1, 1, 1, 1, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
This configuration means the following:
libuarte 0: Uses Timer 0 for byte counting and RTC0 for timeouts.
libuarte 1: Uses Timer 1 for byte counting and RTC1 for timeouts.
However, I had to modify the SDK, specifically, app_timer2.c to utilize RTC2 instead of RTC1. Currently, app_timer2.c (on line 75) sets the RTC driver instance ( DRV_RTC_INSTANCE() ) to one and is non-configurable. This forces the user to also define APP_TIMER_V2_RTC1_ENABLED as a C define.
Leaving app_timer2.c as is will result in a compiler error regarding a double definition of RTC1_IRQHandler. This is because both nrfx_rtc.c and drv_rtc.c both define it.
To force app_timer2.c to only utilize RTC one seems unnecessary? This was brought up in a separate post but looks like it was not resolved: devzone.nordicsemi.com/.../enable-the-use-of-rtc0-rtc1-or-rtc2-in-app_timer2
Follow up questions:
- Are there any concerns or consequences with changing app_timer2.c to use RTC2 instead of RTC1? i.e. Is there a use case or reason to make app_timer2.c setup this way?
- I'd rather not change the SDK but I also know that Nordic has now moved to NCS which means there won't be a new nRF SDK with this problem addressed. That being said, should I leave app_timer2.c on RTC1 and have libuarte one use RTC2 instead?
I am looking forward to hearing your thoughts and input. Please let me know if you need more information from me.
Thanks,
Sam