KSDK I2C FreeRTOS Driver Bug?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KSDK I2C FreeRTOS Driver Bug?

Jump to solution
970 Views
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

Labels (1)
0 Kudos
1 Solution
653 Views
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

View solution in original post

0 Kudos
2 Replies
654 Views
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 Kudos
653 Views
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 Kudos