This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

app_timer_start error code 4

What does error code 4 mean? I am looking through the documentation for the error code number to string translation.

Why is starting a timer causing the error code 4?

The timer is setup as follows, it was previous 10, which should have been more than enough.

#define APP_TIMER_PRESCALER             0                                           
#define APP_TIMER_MAX_TIMERS           13
#define APP_TIMER_OP_QUEUE_SIZE        13

APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);

err_code = app_timer_create(&m_led_on_timer_id, APP_TIMER_MODE_SINGLE_SHOT, led_on_timeout_handler);

Error code 4, occurs trying to start the led timer. void led_on_start(void) { uint32_t err_code; // Start led timers. err_code = app_timer_start(m_led_on_timer_id, led_t_on, NULL); APP_ERROR_CHECK(err_code); }

  • Just type NRF_ERROR_INVALID_PARAM into the search box in the documentation to find ..

    #define 	NRF_ERROR_NO_MEM   (NRF_ERROR_BASE_NUM + 4)
     	No Memory for operation. 
    

    and in the timer reference ..

    NRF_ERROR_NO_MEM	Timer operations queue was full.
    

    so your operations queue is full. Why .. that you need to figure out. You could just put a breakpoing on the app_timer_start() function see how many times you're calling it.

  • Ok thank you very much.

Related