1 Reply Latest reply on Jul 9, 2019 2:11 AM by BragadeeshV_41

    PSOC5: Hang in I2CM_MasterWriteBuf under FreeRTOS

    ZvVe_2582751

      Hello,

       

      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 ?

       

      Thank you,

      Zvika