This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS-RTOS2 Using mutex

Hi,
I'm new with the CMSIS-RTOS2. I want to test the Mutexes, so I read the online documentation and I create the Mutex.c template file from Keil.

I see from the template file that the mutex is placed inside a thread, so I have some questions:

1. A mutex must belongs to a dedicated thread?
2. What if I create 1, 2 or 3 mutexes in my main thread and use them (for peripheral access, for example)?
3. The Mutex.c file has a bug at line 16 while check the mutex creation failure?

From Mutex.c file:

15  mid_Thread_Mutex = osMutexNew (NULL);
16  if (!tid_Thread_Mutex) {

Thanks in advance,
Antonio