This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
i2c_target_rw_multibyte_fifo_interrupts_LP_MSPM0G3519_nortos_ticlang.rar
I am currently debugging IIC communication through the launchpad. Sending data through IIC0 and receiving data through IIC2. Two interfaces can receive data normally through interrupt mode. But changing IIC2 to DMA mode, data reception cannot be completed. Can you provide an example of IIC transmitting and receiving data through DMA? Please help locate the issue in the attachment the code I modified. thank you.
Which side of the I2C is this operating? The name says "target" but the code all seems to be acting as a controller.
-------------
More generally:
> gTxCount0 = DL_I2C_fillControllerTXFIFO(I2C_0_INST, &gTxPacket0[0], gTxLen0);
The DMA transfers from memory to the FIFO, so you shouldn't pre-fill the FIFO here. Doing this throws the (DMA vs I2C) counts off.
--------------
In addition to the suggestions in the thread you referenced, it might be useful to start with the SPI_send() function in example "spi_controller_repeated_fifo_dma_interrupt" here:
https://dev.ti.com/tirex/explore/node?node=A__AC8uwWRQ8P8dtELVi9opaA__MSPM0-SDK__a3PaaoK__LATEST
Two subtle points here:
1) Since SPI is bi-directional, that function sets up both Tx and Rx DMA channels. The I2C will only use one or the other for any given transaction.
2) For SPI, the initial Tx trigger is always "primed", so enabling the DMA immediately starts the transaction. For I2C, this won't happen until you call DL_I2C_startControllerTransfer().