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.

LAUNCHXL-F28379D: SPI Communication between 2 LAUNCHXL-F28379D

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hello TI Officers,

I am working on a project where 2 LAUNCHXL-F28379D are communicating through SPI to each other at 40 Mbps, full duplex. I have gone through multiple examples of C2000Ware on SPI, and now my program uses SPI with DMA ( one channel each for SPI reading from SPIRXBUF to memory and SPI writing from memory to SPITXBUF) and FIFO to transfer a block of 1280 words from the master to slave, and vice versa at the same time.

The problem is that when I tried running the program, sometimes it worked fine, the data received are all correct and if I changed the sending data at one side, the other side would get it. However, sometimes, when the program ran everything ran in crazy. All the received data are wrong, and was continuously changing.

To be specific, I am always running the slave first, so that DMA loads data to SPITXBUF first and the DMA assigned for SPI reception is turned on to be ready to receive any incoming data. I could see in "Registers" that the correct data is loaded to SPITXBUF. Then, I ran the master side, and all data received are wrong. I tried halting the master MCU so that it stops after each transmission. And, what I saw is that, on master side the DMA always finished its TRANSFER_COUNT, which is expected. But on the slave MCU, it doesn't all the time. There are still some TRANSFER_COUNT needs to be done, but they are not finished. And then, on the next transmission, master sends data, slave sends redundant data from the last DMA transfer, and a number of new data for the new transmission. In other words, data sent by slave is shifted causing the whole communication wrong.

Regards,
An