Skip to main content
MLe M.1
Associate II
Sep 10, 2024 8:02 AM UTC
Question

freertos cmsis_os2 osTimerStop returns osErrorResource (stm32l431 + STM32CubeIde)

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.

3 replies

ST Employee
Sep 11, 2024 4:36 PM UTC

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())

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
MLe M.1
MLe M.1Author
Associate II
Oct 1, 2024 9:29 AM UTC

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
Jun 6, 2025 11:26 AM UTC

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