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

Use RTC1 CC[1] with ble_Conn_params.c

Hi, I have a project where, I need to change the minimum and maximum (MIN_CONN_INTERVAL and MAX_CONN_INTERVAL) connection interval to higher values like 1 second and 2 second. So, I need RTC1 CC[0] for keeping track of connection interval. But I need another RTC for led blinking and tracking other timeouts in my code. So, I used RTC CC[1] to do this purpose. The problem is, during a disconnection with the app, in ble_conn_params.c, under on_disconnect, the RTC1 is stopped (app_timer_stop). As a result of this, my periodic led blinks and timeouts for other parts of the code don't work (because the timer RTC1 is stopped). How to get around with this? I use nRF51822 AA and SDK 10.0.0 S130.THanks.

Parents
  • Hi

    I also facing a similar problem here. I merged a blink rtc freertos example with softblink example. The result was horrible with fast blink on my board + led stop blinking issue. I suspect it caused by the freertos rtc timer enter tickless idle mode.

    int main(void)
    {
        ret_code_t err_code;
        lfclk_init();
    
        // Start APP_TIMER to generate timeouts.
        err_code = app_timer_init();
        APP_ERROR_CHECK(err_code);
    
        const led_sb_init_params_t led_sb_init_param = LED_SB_INIT_DEFAULT_PARAMS(LEDS_MASK);
    
        err_code = led_softblink_init(&led_sb_init_param);
        APP_ERROR_CHECK(err_code);
    
        err_code = led_softblink_start(LEDS_MASK);
        APP_ERROR_CHECK(err_code);
    
        
        /* Activate deep sleep mode */
        SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    
        /* Start FreeRTOS scheduler. */
        vTaskStartScheduler();
        
        while (true)
        {
            __WFE();
        }
    }
    

Reply
  • Hi

    I also facing a similar problem here. I merged a blink rtc freertos example with softblink example. The result was horrible with fast blink on my board + led stop blinking issue. I suspect it caused by the freertos rtc timer enter tickless idle mode.

    int main(void)
    {
        ret_code_t err_code;
        lfclk_init();
    
        // Start APP_TIMER to generate timeouts.
        err_code = app_timer_init();
        APP_ERROR_CHECK(err_code);
    
        const led_sb_init_params_t led_sb_init_param = LED_SB_INIT_DEFAULT_PARAMS(LEDS_MASK);
    
        err_code = led_softblink_init(&led_sb_init_param);
        APP_ERROR_CHECK(err_code);
    
        err_code = led_softblink_start(LEDS_MASK);
        APP_ERROR_CHECK(err_code);
    
        
        /* Activate deep sleep mode */
        SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    
        /* Start FreeRTOS scheduler. */
        vTaskStartScheduler();
        
        while (true)
        {
            __WFE();
        }
    }
    

Children
Related