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

app_timer_start does not start the timer (freeRTOS)

Hello 

I'm facing an issue with app_timer_start. Indeed, with small values, sometimes, the app_timer_start won't start the timer. As a result, the interrupt handler is not triggering. 

i'm using FreeRTOS, i know that app_timer is using a specific task to handle timer. Here is the part of the code triggering the issue : 

static uint32_t haptic_start_pattern(void)
{
    ret_code_t err_code = NRF_ERROR_INTERNAL;

    haptic_start();

    if (m_current_pattern.rising_steps == 0)
    {
        m_haptic_phase = HAPTIC_HIGH_PHASE;
        haptic_set_duty_cycle(m_current_pattern.dc_max);
        if (m_current_pattern.high_level_time_ms)
        {
            err_code = app_timer_start(m_haptic_timer_handle, APP_TIMER_TICKS(10), NULL);
            APP_ERROR_CHECK( err_code );
        }
    }
    else
    {
        m_haptic_phase = HAPTIC_RISING_PHASE;
        haptic_set_duty_cycle(m_current_pattern.rising_steps);
        err_code = app_timer_start(m_haptic_timer_handle, APP_TIMER_TICKS(10), NULL);
        APP_ERROR_CHECK( err_code );
    }

    return err_code;
}

I plan to not use app_timer when i need to handle small time value.

Has someone already faced this issue ?

Thank you in advance,

Aurélien

Parents Reply Children
No Data
Related