RT1064 I2C+eDMA error occur when address wrong

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

RT1064 I2C+eDMA error occur when address wrong

733 Views
weber791024
Contributor I

Hi,

    First post here,I use evkmimxrt1064_lpi2c_edma_b2b_transfer_master this project to test I2C, and found that if my I2C1 doesn't connect anything or get a nak, then my edma will always busy and g_MasterCompletionFlag always true, then I couldn't send another data anymore.

    How can I fix it?Use LPI2C_MasterCheckAndClearError to detected and clear the flag?Or use LPI2C_MasterTransferAbortEDMA behind the LPI2C_MasterTransferEDMA?

    I just want make sure that if something wrong happened and I still can send data.

#i.mx rt 1064

#sdk2.7.0

Labels (1)
Tags (2)
0 Kudos
3 Replies

629 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello ,

Hope you are doing well.

I'd like to reproduce this from my end so I can check which may be the better option. From my understanding what you are doing is running the evkmimxrt1064_lpi2c_edma_b2b_transfer_master example and at a certain point disconnect the device, correct? After the device is disconnected then you experience the above behavior. 

Did you make any changes to the example or you are using it as is it?

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos

629 Views
weber791024
Contributor I

Did you make any changes to the example or you are using it as is it?

No.

0 Kudos

629 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello ,

Hope you are doing well.

I would recommend to use first the LPI2C_MasterTransferAbortEDMA to terminate the transfer early. The LPI2C_MasterCheckAndClearError is better used to check for errors. You may also check for the error prior to aborting the transfer to see if you didn't get a nack what other issue may be occurring.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos