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

Trying to use TIMER2 for FreeRTOS tick with SoftDevice running

Hi,

The established time tick source for FreeRTOS is RTC1 via the APP_TIMER module. I am trying to shift the basis of the APP_TIMER from RTC1 to TIMER2, so that I can use RTC1 to maintain calendar time. I intend to sleep the processor, waking on an external interrupt. Since RTC1 is low power timer, I was planning on keeping that running while the processor was mostly shut down and waiting for the wake-on-interrupt.

Is there any guidance on shifting the APP_TIMER module from RTC1 to TIMER2?

Thanks!

Parents
  • I wrote an earlier port of FreeRTOS for the nRF51. I have not yet migrated our own code to use the SDK versio of the FreeRTOS yet. I'm not 100% sure of this yet, but probably you can share the RTC1.

    There is no problem putting FreeRTOS into sleep on nRF51. It could be enough it you compile it with configUSE_TICKLESS_IDLE and configUSE_IDLE_HOOK enabled and add the following idle hook:

    void vApplicationIdleHook( void ) {
        /*
           This signals the softdevice handler that we want the CPU to
           sleep until an event/interrupt occurs. During this time the
           softdevice will do what it needs to do; in our case: send
           adverts
        */
    
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    }
    

    I'm interested in hearing your experiences.

    Pertti

Reply
  • I wrote an earlier port of FreeRTOS for the nRF51. I have not yet migrated our own code to use the SDK versio of the FreeRTOS yet. I'm not 100% sure of this yet, but probably you can share the RTC1.

    There is no problem putting FreeRTOS into sleep on nRF51. It could be enough it you compile it with configUSE_TICKLESS_IDLE and configUSE_IDLE_HOOK enabled and add the following idle hook:

    void vApplicationIdleHook( void ) {
        /*
           This signals the softdevice handler that we want the CPU to
           sleep until an event/interrupt occurs. During this time the
           softdevice will do what it needs to do; in our case: send
           adverts
        */
    
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
    }
    

    I'm interested in hearing your experiences.

    Pertti

Children
No Data
Related