Semaphore in FreeRTOS doesn’t work
Somewhere in your main or before the while(1) you should have created the semaphore with one of the following
xSemaphoreCreateBinary
xSemaphoreCreateBinaryStatic
xSemaphoreCreateCounting
xSemaphoreCreateCountingStatic
xSemaphoreCreateMutex
xSemaphoreCreateMutexStatic
xSemaphoreCreateRecursiveMutex
xSemaphoreCreateRecursiveMutexStatic