Skip to content

UM1722 On semaphores example #1

@Williamzhangtw

Description

@Williamzhangtw

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions