AnsweredAssumed Answered

TWR-K65F180M I2C Send/Receive Not Working

Question asked by Alex Deddo on Dec 10, 2015
Latest reply on Dec 12, 2015 by Jorge_Gonzalez



I'm using a TWR-K65F180M board and trying to communicate with an MPU I've attached to PTE18/PTE19 SDA/SCK. Whenever I run:


I2C_DRV_MasterSendData(i2cCom1_IDX, &i2cCom1_MasterConfig0, NULL, 0, wrBuf, sizeof(wrBuf));




I2C_DRV_MasterReceiveData(i2cCom1_IDX, &i2cCom1_MasterConfig0, NULL, 0, rdBuf, sizeof(rdBuf));


I get a return of kStatus_I2C_Success, however the buffer is always empty when data is normally expected.


Under linux my driver works perfectly for this chip, using standard I2C API:


uint8_t buf[8];

struct i2c_msg msg[] = {

     .addr = client->addr,

     .flags = I2C_M_RD,

     .len = sizeof(buf),

     .buf = buf,


i2c_transfer(client->adapter, msg, 1);


Also, calls like this loop forever:

I2C_DRV_MasterGetSendStatus(i2cCom1_IDX, NULL);

I2C_DRV_MasterGetReceiveStatus(i2cCom1_IDX, NULL);


Additionally, I can't seem to communicate with the internal accelerometer either, using similar methods.


KDS 3.0.0 / PE 3.0.1 / KSDK 1.3.0


There doesn't seem to be any documentation on how I should be setting this up, not that I'm asking to have my hand held here or anything... But if there's something here I'm missing please help so I can use the Freescale platform.