cancel
Showing results for 
Search instead for 
Did you mean: 

freertos cmsis_os2 osTimerStop returns osErrorResource (stm32l431 + STM32CubeIde)

MLe M.1
Associate II

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 2
Sarra.S
ST Employee

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.

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