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

app_timer_stop return 0x04(NO MEM) error

Hi, all..

An error occurs as soon as it connect and disconnect through advertising. Timer interrupt is currently running on the main function..

and then I found error meaing.. below.. 

 

 * @retval     NRF_ERROR_NO_MEM          If the timer operations queue was full.
 */
ret_code_t app_timer_stop(app_timer_id_t timer_id);

so 'timer operation queue was full' is the reason..

then where should I check? 

BR,

lyrics

Parents Reply Children
  • Hi, Jared

    Are you using  ble_app_uart_c i.e the central NUS example?

    My project is based ble_app_uart ! So I added scan module.

    I use NRF_DRV_TIMER_INSTANCE.

    This is my timer_init code.. and call every 200ns, 1000ns (1ms) in the main.

    static void timers_init(void)
    {
        ret_code_t err_code ;
        uint32_t time_ticks, time_ticks_us;
    
        /** added */
        nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
        timer_cfg.frequency = 0;
        err_code = nrf_drv_timer_init(&TIMER_MS, &timer_cfg, timer_ms_event_handler);
        APP_ERROR_CHECK(err_code);
    
        time_ticks = nrf_timer_us_to_ticks(time_ms, 0);
        nrf_drv_timer_extended_compare(
             &TIMER_MS, NRF_TIMER_CC_CHANNEL0, time_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
        nrf_drv_timer_enable(&TIMER_MS);
    
        //us_timer
        nrf_drv_timer_config_t timer_cfg_2 = NRF_DRV_TIMER_DEFAULT_CONFIG;
        timer_cfg_2.frequency = 0;
        err_code = nrf_drv_timer_init(&TIMER_US, &timer_cfg_2, timer_us_event_handler);
        APP_ERROR_CHECK(err_code);
    
        time_ticks_us = nrf_timer_us_to_ticks(time_us, 0);
        nrf_drv_timer_extended_compare(&TIMER_US, 
                                        NRF_TIMER_CC_CHANNEL1,
                                        time_ticks_us, 
                                        NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, 
                                        true);
        nrf_drv_timer_enable(&TIMER_US);
    }

    This is my main func..

    while(1)
    {
        sys_us_timer();
        sys_ms_timer();
    }

  • Whoops! I deleted your previous reply on accident. But you wrote that you had fixed the issue by including the init function for the application timer right?

    sorry

    Jared 

  • But you wrote that you had fixed the issue by including the init function for the application timer right?

    Yes!

    That's all right. Thank you :)

Related