KDS I2C getting stuck

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

KDS I2C getting stuck

693 Views
albertolubeiro
Contributor III

Hi everybody,

I am using KDS3.0 and KDSK v1.2.0 with PEX and im having an issue with I2C

I want to send a 0xF1 command to a sensor but the code get stuck in the following line.

/* Wait for the transfer to finish.*/

    I2C_DRV_MasterWait(instance, timeout_ms);

Inside this function there is the following code:

do

   {

        syncStatus = OSA_SemaWait(&master->irqSync, timeout_ms);

    }while(syncStatus == kStatus_OSA_Idle);

I use the non-blocking function I2C_DRV_MasterSendDat, so it should get out of here because of a time out

Any idea?

I am really concerned. it is pretty urgent issue

Thanks and best regards

Alberto

3 Replies

428 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Alberto Lubeiro:

From your other posts I understand you are using MQX. Then the problem may be that you are not installing the I2C interrupt from fsl_i2c component in Processor Expert. Please see the picture below:

pastedImage_0.png

Let us know if this works.


Regards!,
Jorge Gonzalez

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

0 Kudos

428 Views
albertolubeiro
Contributor III

Hi Santiago, Jorge.

The presure sensor was faulty or broken.

Thamks and best regards!

428 Views
santiago_gonzal
NXP Employee
NXP Employee

Hello Alberto,

The function that is used in the I2C DRV example to wait for a transaction to finish is the following:

// Wait until finish send

   while(I2C_DRV_MasterGetSendStatus(BOARD_I2C_COMM_INSTANCE, &bytesRemaining) != kStatus_I2C_Success) {}

Can you try with this one instead of the Wait Function, and let us know if it works?

Regards,

Santiago

0 Kudos