I am working on KW41 microcontroller and using KDS for development. I have to do i2c communication, for that I am using FreeRTOS library. I am calling I2C_RTOS_Transfer to read a register in my I2C device. Please have a look on below defination of I2C_RTOS_Transfer :
status_t I2C_RTOS_Transfer(i2c_rtos_handle_t *handle, i2c_master_transfer_t *transfer)
/* Lock resource mutex */
if (xSemaphoreTake(handle->mutex, portMAX_DELAY) != pdTRUE)
status = I2C_MasterTransferNonBlocking(handle->base, &handle->drv_handle, transfer);
if (status != kStatus_Success)
/* Wait for transfer to finish */
/* Unlock resource mutex */
/* Return status captured by callback function */
This program is hanging while executing the xSemaphoreTake command highlighted with red color.
while looking in code with debugger, the program is going to hang while executing portYIELD_WITHIN_API(); in queue.h library.
Can somebody help me to resolve this problem.