Part Number: TM4C1294NCZAD
Other Parts Discussed in Thread: TMP100
Dear team,
My customer uses I2C FIFO DMA . The following is the I2C setting:
I2CRxFIFOConfigSet(i2c_udma_setting[i].I2C_BASE, I2C_FIFO_CFG_RX_MASTER_DMA | I2C_FIFO_CFG_RX_TRIG_3); 设置 tiger 为3 bytes I2CMasterBurstLengthSet(i2c_udma_setting[i].I2C_BASE, 3); uDMAChannelControlSet(ui32ChannelNum | UDMA_PRI_SELECT, UDMA_SIZE_8 | UDMA_SRC_INC_NONE | UDMA_DST_INC_8 | UDMA_ARB_4); uDMAChannelTransferSet(ui32ChannelNum | UDMA_PRI_SELECT, UDMA_MODE, (void *)(i2c_udma_setting[index].I2C_BASE + I2C_O_FIFODATA), (void *)g_ui8I2CMasterRxDataA[index], 3);
The following is the beginning of FIFO burst receive
I2CMasterSlaveAddrSet(ui32Base, i2c_addr, true);
I2CMasterControl(ui32Base, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_START);
The following is the I2C interrupt
ui32Mode = uDMAChannelModeGet(i2c_udma_setting[index].DMA_Channel | UDMA_PRI_SELECT);
if (ui32Mode == UDMA_MODE_STOP)
{
ui32Mode = I2CMasterBurstCountGet(i2c_udma_setting[index].I2C_BASE);
I2CMasterControl(i2c_udma_setting[index].I2C_BASE, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_FINISH);
}
In
I2CMasterControl(i2c_udma_setting[index].I2C_BASE, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_FINISH);
he sets hardware interrupt:
After executing I2C_MASTER_CMD_FIFO_BURST_RECEIVE_START
I2CMasterControl(ui32Base, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_START);
Look at the waveform with an oscilloscope, and you can see the normal I2C waveform that reads 3 bytes. At this time, it stops at the I2C interrupt ( I2CMasterControl(i2c_udma_setting[index].I2C_BASE, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_FINISH); )
Then single step, the customer sees another 3 bytes of data is read out, and there is an I2C STOP waveform.
According to the customer's understanding, there should be only one I2C STOP waveform and no more 3 bytes of data.
If the client sets the burst size to 4, there are 8 bytes of data to read. Set to 8 and there are 16 data to read.
It seems that the read data is twice the burst setting, this should be a problem.
Please help.