S32K144: LPI2C Master Receive Blocked for more than 4 bytes

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

S32K144: LPI2C Master Receive Blocked for more than 4 bytes

730 Views
sundaram_v
Contributor II

Hello Team,

Currently, we have two S32K144 devices, and one is acting as an IIC master and the other as a slave.

We were implementing the LPI2C mechanism (Master and Slave) for communication between two S32K144 devices using FREERTOS.

Our communication protocol follows: for each master request, the slave should respond with 5 bytes.

When we tried the above, we observed that LPI2C FIFO supports only 4 bytes of reception at a time because master->rxSize = 1 and keeps master->state as STATUS_BUSY. It is not allowing the LPI2C receive blocking to come out of the semaphore.

Please find the code snippet below:

ret = lpi2c_write(txBuf, 1, false, 10UL);

status_t lpi2c_write(const uint8_t * txBuff, uint32_t txSize, bool sendStop, uint32_t timeout)
{
return LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C1, txBuff, txSize, sendStop, timeout);
}

ret = lpi2c_read(rxBuf, len, true, 10UL);

status_t lpi2c_read(uint8_t * rxBuff, uint32_t rxSize, bool sendStop, uint32_t timeout)
{
return LPI2C_DRV_MasterReceiveDataBlocking(INST_LPI2C1, rxBuff, rxSize, sendStop, timeout);
}


Please see the attached image where it gets stuck.

We would like to know how to resolve this issue.

Please give us priority on this.

Note: We also need to receive a 15-byte response for some of the commands. Currently, we are stuck with receiving a 5-byte response.

Thanks
Sundar

 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

493 Views
NamLee
NXP Employee
NXP Employee

Hi sundaram_v,

My idea is about the application, when you can use some txBuffer and rxBuffer to handle the transmit and receive data, for completely sending each 4 bytes data frame from slave side.

Not sure about your version of MCAL that you're using, i checkd RTD 2.0.3 and saw I2C have function for setup the buffer size and send each 8 bytes.

Please give me your version MCAL and if it possible with your project configuration?

Thank you,
Nam.

 

 

 

0 Kudos
Reply