SDAA529 September 2026 MSPM33C321A
The read path is the performance-critical direction for the streaming use case in this document. The example configures a quad I/O read with the dummy-cycle count required by the fast-read command, selects a 16-bit FIFO word size to halve the number of DMA transactions, and hands the transfer to QSPIFLASH_readDMA():
commandConfig.instruction = QUAD_IO_READ_CMD;
commandConfig.addressSize = QSPIFLASH_ADDRESS_SIZE_3BYTE;
commandConfig.address = ADDRESS;
commandConfig.dummyCycles = DUMMY_CYCLES_QUAD_IO_READ;
commandConfig.transferMode = QSPIFLASH_TRANSFER_MODE_QPI;
dmaConfig.startDMA = startDMARxTransfer;
dmaConfig.dmaCompleteFlag = &gDMARXDataTransferred;
DL_QSPI_setWordSize(QSPI, DL_QSPI_WORD_SIZE_16);
status = QSPIFLASH_readDMA(&handle, readback_data, sizeof(readback_data), &commandConfig, &dmaConfig);
The driver does not own the DMA channel; instead, the application supplies a start callback so the same code works with any channel assignment. The callback points the channel at the QSPI RX data register, sets the transfer size in 16-bit words, and enables the channel:
void startDMARxTransfer(const void *destAddr, uint32_t sizeBytes)
{
*(dmaConfig.dmaCompleteFlag) = false;
DL_QSPI_enableInterrupt(QSPI_0_INST, DL_QSPI_INTERRUPT_DMA_DONE_RX);
DL_DMA_setSrcAddr(DMA0, DMA0_CH0_CHAN_ID, (uint32_t)(&(QSPI->RXDATA)));
DL_DMA_setDestAddr(DMA0, DMA0_CH0_CHAN_ID, (uint32_t) destAddr);
DL_DMA_setTransferSize(DMA0, DMA0_CH0_CHAN_ID, sizeBytes / sizeof(uint16_t));
DL_DMA_enableChannel(DMA0, DMA0_CH0_CHAN_ID);
}
Completion is signaled by the QSPI DMA_DONE_RX interrupt (QSPI0, interrupt line 47). The handler sets the completion flag polled by the driver and disables the interrupt until the next transfer, a pattern that keeps the interrupt service routine to a few instructions. The write direction mirrors this structure on a second DMA channel targeting the QSPI TX data register.
Three practical notes from the example apply to any application built on this driver:
The example verifies the readback buffer word-for-word against the programmed pattern and reports pass/fail on the LaunchPad LEDs, providing a self-checking starting point before the application replaces the test pattern with real asset data.