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

app_timer stop working after upgrade from 4.3 to 5.2

it just the typical button_timeout, in 4.3 no problem to accept call back


	// Create button polling timer
	err_code = app_timer_create(&m_detection_button_timer_id,
													APP_TIMER_MODE_SINGLE_SHOT,
													button_timeout_handler);

	// Start the timer
	button_timeout_active_event = (1 << IO_PORT_INT_BUTTON);
	err_code = app_timer_start(m_detection_button_timer_id,
														 BUTTON_DETECTION_DELAY, NULL);

above call called but button_timeout_handler never called after upgrade to 5.2, clock is handled by sd:


	uint32_t p_is_running;
	
	sd_clock_hfclk_request();
	do
	{
		sd_clock_hfclk_is_running(&p_is_running);
	} while (p_is_running == 0);
	


Parents
  • I add below timer event just for test:

    
    static void timer_hander(void * p_context) {
        LOG("timer\r\n");
    }
    static void timer_test(void) {
        app_timer_id_t timer_id;
        APP_ERROR_CHECK(app_timer_create(&timer_id,
                                                    APP_TIMER_MODE_SINGLE_SHOT,
                                                    timer_hander));
    	APP_ERROR_CHECK(app_timer_start(timer_id, 30000, NULL));
    
    }
    
    
    

    I get NRF_ERROR_INVALID_LENGTH in line 340 of app_timer.c

    
            uint32_t err_code = m_evt_schedule_func(p_timer->p_timeout_handler, p_timer->p_context);
            APP_ERROR_CHECK(err_code);
    
    
    
Reply
  • I add below timer event just for test:

    
    static void timer_hander(void * p_context) {
        LOG("timer\r\n");
    }
    static void timer_test(void) {
        app_timer_id_t timer_id;
        APP_ERROR_CHECK(app_timer_create(&timer_id,
                                                    APP_TIMER_MODE_SINGLE_SHOT,
                                                    timer_hander));
    	APP_ERROR_CHECK(app_timer_start(timer_id, 30000, NULL));
    
    }
    
    
    

    I get NRF_ERROR_INVALID_LENGTH in line 340 of app_timer.c

    
            uint32_t err_code = m_evt_schedule_func(p_timer->p_timeout_handler, p_timer->p_context);
            APP_ERROR_CHECK(err_code);
    
    
    
Children
No Data
Related