Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

APP_TIMER_V2 does not appear to generate timer interrupts

I am using SDK 17.1.0 with an nRF52832 design similar to the P10040.

I was previously using the original timer application and things were looking good.
I decided to upgrade to SDK 17.1.0 and am using the uart example under 'ble_peripherals' to boot strap my project.

Based on another project using SDK 17.1.0, I decided to move up to the newer version of the application timer.
I defined the symbols 'APP_TIMER_V2' and 'APP_TIMER_V2_RTC1_ENABLED' in the build.

My first question is:  I do not quite understand "why do I need to enable the RTC1"?  -- and when I try to build without using this symbol then I get a build error that there is no RTC instance defined in the build.

My next comment (based on observations) is that when I enable RTC1 then I notice that the processor enters the nrf_power_mgmt phase but never fires the timer handler that I expect to be triggered every 1 second. I have validated that
    a) the firmware has indeed called the 'app_timer_init()' function, 
    b) that this 1-second timer has been created as a 'repeat-mode' timer with a 1 second timeout with no errors, and
    c) that the timer has indeed been started.

I am sure that I am missing something here -- likely some kind of connection between the hardware RTC and the firmware handler but am still struggling to nail it down.

Cheers
RVM

Parents
  • Hello RVM,

    My first question is:  I do not quite understand "why do I need to enable the RTC1"?  -- and when I try to build without using this symbol then I get a build error that there is no RTC instance defined in the build.

    The App timer library is based on the RTC1, which is why you will need to enable this RTC instance.

    My next comment (based on observations) is that when I enable RTC1 then I notice that the processor enters the nrf_power_mgmt phase but never fires the timer handler that I expect to be triggered every 1 second. I have validated that

    Could you show me the code for the configuration and initialization of your app timer instance?
    If the timer is set up correctly to trigger a compare event every 1 second it will wake up the device from the SYSTEM_ON sleep to process the event. Once the event has been processed it will go back to sleep, unless there are other events or functions that need processing before it does.

    Best regards,
    Karl

  • If the timer is set up correctly to trigger a compare event every 1 second it will wake up the device from the SYSTEM_ON sleep to process the event. Once the event has been processed it will go back to sleep, unless there are other events or functions that need processing before it does.

    I did not go through any steps to set up the core RTC module itself -- I assumed that the app timer module would take care of it when it is initialized.

    If that is not the case, what exactly are the steps to set up the RTC? I did not realize that simply enabling the RTC would not be enough and that I have to set up extra 'comparators'?

Reply
  • If the timer is set up correctly to trigger a compare event every 1 second it will wake up the device from the SYSTEM_ON sleep to process the event. Once the event has been processed it will go back to sleep, unless there are other events or functions that need processing before it does.

    I did not go through any steps to set up the core RTC module itself -- I assumed that the app timer module would take care of it when it is initialized.

    If that is not the case, what exactly are the steps to set up the RTC? I did not realize that simply enabling the RTC would not be enough and that I have to set up extra 'comparators'?

Children
No Data
Related