Skip to main content
Explorer
September 10, 2024
Question

freertos cmsis_os2 osTimerStop returns osErrorResource (stm32l431 + STM32CubeIde)

  • September 10, 2024
  • 2 replies
  • 964 views

Hello,

With freertos cmsis_os2 osTimerStop() returns osErrorResource despite timer is running and trigs the callback after the correct time.

Is there a known bug?

How a timer returning pdFALSE at test xTimerIsTimerActive (hTimer) can trig a callback???

How can I stop the timer otherwise?

Best regards

Mich

    This topic has been closed for replies.

    2 replies

    ST Employee
    September 11, 2024

    Hello @MLe M.1

    This is probably an incorrect handling of the timer state, what you're describing is discrepancy between the timer's actual state and its reported state, maybe try using the native FreeRTOS API to stop the timer (xTimerStop())

    MLe M.1Author
    Explorer
    October 1, 2024

    Hello Sara,

    I used osTimerStart() and osTimerStop() functions because I follow STM FreeRTOS_v2.0 - CMSIS OS API.pdf document and MOOC:

    https://www.youtube.com/watch?v=pGLQA0-qbmU&list=PLnMKNibPkDnExrAsDpjjF1PsvtoAIBquX&index=54

    When I use the (xTimerStop() function it always trigs a timer event o the stop ....

    Best regards

    Michel

     

    Explorer II
    June 6, 2025

    Hello,

    I have the same problem, osTimer is useless. cmsis_os has no reason to exist, it's only a wrapper adding overhead and it's full of bugs.

    Best regards

    Leo