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.

TMS570LC4357: SPI1 cannot use DMA for first data

Part Number: TMS570LC4357

Hi team,

SPI dual machine communication test on TMS570LC4357. SPI3 is the master and SPI1 is the slave. The slave receives and transmits data through the DMA.

During the test, the scope shows that the master can normally generate the CS, SCK, and MOSI signals. Miso reads as 0. The hardware connection is confirmed to be correct, but the slave SPI1 is unable to receive or transmit data (transmitted data is the default value of 0x00). The following are the DMA configurations: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uint16 SPI1_TX_Data[D_SIZE];
uint16 SPI1_RX_Data[D_SIZE];
g_dmaCTRL g_dmaCTRLPKT1;
g_dmaCTRL g_dmaCTRLPKT2;
void DMA_Config(void)
{
dmaEnable();
//DMA transmit channel 0
g_dmaCTRLPKT1.SADD = (uint32)&SPI1_TX_Data[0]; // source address
g_dmaCTRLPKT1.DADD = (uint32)(&(spiREG1->DAT1)); // destination address
g_dmaCTRLPKT1.CHCTRL = 0; // channel control
g_dmaCTRLPKT1.FRCNT = 1; // frame count
g_dmaCTRLPKT1.ELCNT = D_SIZE; // element count
g_dmaCTRLPKT1.ELDOFFSET = 0; // element destination offset
g_dmaCTRLPKT1.ELSOFFSET = 0; // element source offset
g_dmaCTRLPKT1.FRDOFFSET = 0; // frame destination offset
g_dmaCTRLPKT1.FRSOFFSET = 0; // frame source offset
g_dmaCTRLPKT1.PORTASGN = PORTA_READ_PORTB_WRITE;
g_dmaCTRLPKT1.RDSIZE = ACCESS_16_BIT; // read size
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Could you help check is there anything need to be modified? Thanks.

Best Regards,

Cherry