KSDK I2C FreeRTOS Driver Bug?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KSDK I2C FreeRTOS Driver Bug?

跳至解决方案
983 次查看
ryanbryngelson
Contributor I

Hello,

 

I'm working on a project that makes use of KSDK 2.0 and FreeRTOS on a KW41 using I2C.  I noticed I was receiving a valid response (return value of 0) from I2C_RTOS_Transfer when the device wasn't connected (which ultimately resulted in a NAK as far as the KW41 was concerned).  I traced the issue down to I2C_RTOS_Callback located in KSDK_2.0/devices/MKW41Z4/drivers/fsl_i2c_freertos.c.  The status variable passed into the callback is correctly reflecting the NAK on the bus, however, it's not copied to handle->async_status, which is what is returned from I2C_RTOS_Transfer.  Here's the method in question with my addition in red...

 

static void I2C_RTOS_Callback(I2C_Type *base, i2c_master_handle_t *drv_handle, status_t status, void *userData)
{
    i2c_rtos_handle_t *handle = (i2c_rtos_handle_t *)userData;
    BaseType_t reschedule;

 

    handle->async_status = status;

 

    xSemaphoreGiveFromISR(handle->sem, &reschedule);
    portYIELD_FROM_ISR(reschedule);
}

 

Thoughts?

 

Ryan

标签 (1)
0 项奖励
1 解答
666 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Ryan:

Yes, I can reproduce your issue on my side. We will add a status propagation . 

This fix will be merged to next release.

Thank you very much.

Regards

Daniel

在原帖中查看解决方案

0 项奖励
2 回复数
667 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Ryan:

Yes, I can reproduce your issue on my side. We will add a status propagation . 

This fix will be merged to next release.

Thank you very much.

Regards

Daniel

0 项奖励
666 次查看
danielchen
NXP TechSupport
NXP TechSupport

HI Ryan:

Thank you for your input, let me reproduce your issue in my side first, I will update you when I have results.

Regards

Daniel

0 项奖励