Skip to main content
MLe M.1
Associate II
September 10, 2024
Question

freertos cmsis_os2 osTimerStop returns osErrorResource (stm32l431 + STM32CubeIde)

  • September 10, 2024
  • 2 replies
  • 966 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

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.1
MLe M.1Author
Associate II
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

 

Associate
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