About semaphore deadlock and idle task hook

Can you try changing that to xSemaphoreCreateMutex ?

Sorry, I don’t know what the test points are when replacing the interface.
I want to confirm whether the sequence issue mentioned below will still occur after replacing the interface?

Not sure what you mean by “replacing the interface”. If you mean switching to use mutex, I asked that because you are using it to protect access to a resource. Semaphore should be used for inter-task synchronization.

Yes, I mean switching to use mutex that the interface from xSemaphoreCreateCountingStatic to xSemaphoreCreateMutex.
And I know the semaphore should be used for inter-task synchronization.
But I want to confirm whether the sequence issue mentioned above will still occur after switching to use mutex?

Yes, it will happen but priority inheritance would prevent deadlock. Please try and let us know the result.

Sorry for the late reply.
I think there is no problem in using mutex to manage resources.
But we have decided not to use semaphore to manage resources in the project, so this topic is closed without any problem.

Thanks again for your support.

Thank you for reporting back!