When using the MCU hardware SPI interface, it is expected that DMA can be configured as block transmission, the transmission byte is 4 bytes, the DMA4 channel is used, and the triggering mode of 4 channels is triggered by software, the specific code is as follows,
byteLength = 4;
DMACTL1 = DMA3TSEL__UCA3RXIFG; // per SLASE54C Table 6-11
DMACTL2 = 0;
// SPI Rx side: single, byte(s), increment dest, not source.
__data20_write_long((uintptr_t)&DMA3SA, (uintptr_t)&UCA3RXBUF); // __SFR_FARPTR nonsense
__data20_write_long((uintptr_t)&DMA3DA, (uintptr_t)DataRx); // __SFR_FARPTR nonsense
DMA3SZ = byteLength;
DMA3CTL = DMADT_1 | DMADSTINCR_3 | DMASRCINCR_0 | DMADSTBYTE | DMASRCBYTE ;
DMA3CTL |= DMAEN;
DMA4CTL |= DMAEN;
DMA4SZ = byteLength;
// Timer+SPI Tx side: single, bytes(s), increment source, not dest
__data20_write_long((uintptr_t)&DMA4SA, (uintptr_t)DataTx); // __SFR_FARPTR nonsense
__data20_write_long((uintptr_t)&DMA4DA, (uintptr_t)&UCA3TXBUF); // __SFR_FARPTR nonsense
DMA4CTL = DMADT_1 | DMADSTINCR_0 | DMASRCINCR_3 | DMADSTBYTE | DMASRCBYTE ;
but in actual circumstances, it will only send 16bits, and no data is sent out, may I ask if there is a problem with such configuration? At the same time, the Rx channel obtains 4 bytes of data by configuring the DMA3 channel and using RxIFG as the trigger source