Few months ago I created a discussion which I cannot locate.
I tried running I2CM_MasterWriteBuf after xSemaphoreTake.
The semaphore was created using xSemaphoreCreateCounting(1,1);
I used this semaphore because I had 2 tasks that use I2C so I needed a critical section mechanism.
In this scenario, I2CM_MasterWriteBuf hanged.
I think found a solution.
I used xSemaphoreCreateCounting, xSemaphoreTake before running: vTaskStartScheduler();
When I created and used the semaphore in a task, I2CM_MasterWriteBuf worked fine.
Is this the the right solution ?
Welcome back to community.
SemaphoreCreateCounting can be called even before the TaskStartScheduler() is called or in a task. But xSemaphoreTake should be called only from the task and not anywhere else or before TaskStartScheduler()