This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Work with Softdevice and RTC with internal RC oscillator on nRF52832

Hi,

I need to run RTC simultaneously with Softdevice without external low frequency clock source (32.768kHz oscillator).

I used following settings to setup RTC,

RTC_ENABLED 1
RTC2_ENABLED 1
NRFX_RTC_ENABLED 1
NRFX_RTC2_ENABLED 1
NRFX_CLOCK_ENABLED 1
NRF_CLOCK_ENABLED 1

with above settings I was able to use RTC without any problem. And it works with and without external low frequency oscillator.

Then try to work with softdevice. With external oscillator no problem occured. RTC works simultaneously with softdevice, no issue with provisioning or controlling device through mesh.

I can run RTC with internal RC oscillator with following settings,

NRF_CLOCK_LF_SRC_RC 0
NRF_SDH_CLOCK_LF_RC_CTIV 16
NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
NRF_SDH_CLOCK_LF_ACCURACY 1

So when I try to provision device stuck and give Initial Configuration Failed message. If I wasn't try to provision it works fine. (App stuck at Scanning for provisioned node state after sending provision data to the node)

But the device also work fine without RTC with above settings.

So Is there any other configurations need to made ?

Thank you

  • Hi Hung Bui,

    As you suggested I have implemented RTC with SDK v3.2, now I'm able to use use softdevice with RTC without above provisioning issue. 

     In here also I added below libraries to my project,

    • nrf_drv_clock.c
    • nrfx_clock.c
    • nrfx_rtc.c

    And used following settings to configure RTC and 

    • RTC_ENABLED 1
    • RTC2_ENABLED 1
    • NRFX_RTC_ENABLED 1
    • NRFX_RTC2_ENABLED 1 

    Below settings for configure internal RC

    • NRF_SDH_CLOCK_LF_SRC 0
    • NRF_SDH_CLOCK_LF_RC_CTIV 16 
    • NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    • NRF_SDH_CLOCK_LF_ACCURACY 1

    Thank for your to helping me to sort out this matter.

Related