cancel
Showing results for 
Search instead for 
Did you mean: 

UM1722 On semaphores example

William chang
Associate III
Posted on June 24, 2017 at 19:07

I am using cubemx v4.21.0. and the freertos version is 8.2.3. & the cmsis-rtos version is 1.02.

I am using the examples of STM32F413ZH-Nucleo in stm32cube F4 v1.16.0 , when I download the program. It works wrong!

I found the issure  here

static void SemaphoreThread2(void const *argument)

{

....

for (;;)

{

if (semaphore != NULL)

{

/* Try to obtain the semaphore */

if (osSemaphoreWait(semaphore , 0) == osOK)

If I use

if (osSemaphoreWait(semaphore , osWaitForever) == osOK)  instead,It works fine!

Could anyone tell me why  if (osSemaphoreWait(semaphore , 0) == osOK) works wrong?

#um1722 #freertos-stm32cube
1 ACCEPTED SOLUTION

Accepted Solutions
William chang
Associate III
Posted on June 24, 2017 at 23:40

I find the answer, It is because I am using the trace tool,they interact with each other

View solution in original post

1 REPLY 1
William chang
Associate III
Posted on June 24, 2017 at 23:40

I find the answer, It is because I am using the trace tool,they interact with each other