2020-02-14 02:31 PM
Hi,
I am using STM32F405, CMSIS RTOS V1, and STM32CubeIDE. I want to create a timer interrupt that periodically release the semaphore to signal the execution of a task.
The issue is that it gets stuck after osSemaphoreRelease is called in the interrupt. Please refer to my source code.
How do I troubleshoot this?
Thanks.
Solved! Go to Solution.
2020-02-15 05:57 AM
Dont think so, because Semaphore1Handle is passed as a parameter to the task.
In the task you are checking if the semaphore was created., makes sense.
But, in HAL_TIM_PeriodElapsedCallback you are not checking.
Maybe the first IRQ comes too early. Try shifting the line HAL_TIM_Base_Start_IT(&htim3); down.
2020-02-15 05:43 AM
You have two different semaphores. One that looks like CubeMX created "Semaphore1Handle" which you release. Then you create another in StartDefaultTask "semaphore" which you wait on.
2020-02-15 05:57 AM
Dont think so, because Semaphore1Handle is passed as a parameter to the task.
In the task you are checking if the semaphore was created., makes sense.
But, in HAL_TIM_PeriodElapsedCallback you are not checking.
Maybe the first IRQ comes too early. Try shifting the line HAL_TIM_Base_Start_IT(&htim3); down.
2020-02-15 07:28 AM
osSemaphoreRelease is a RTOS API. Do you think it can be called from an interrupt handler? and is the priority of the interrupt low enough to use RTOS calls?
-- pa
2020-02-17 11:59 AM
I did that, and it worked, thanks!!!