Hi Terry
This question was answered internally;
If so, you can specify the number of bytes to transfer in each DMA request in the EDMA_PrepareTransfer function in the bytesEachRequest argument, so your code would be something like:
EDMA_PrepareTransfer(&transferConfig,
srcAddr,
sizeof(srcAddr[0]),
destAddr,
sizeof(destAddr[0]),
4 * sizeof(srcAddr[0]), // 4 * 4 bytes = 16 bytes
sizeof(srcAddr),
kEDMA_MemoryToMemory);
But if you refer to perfom a dma transfer of 4 bytes data each time there is a request by the falling-edge in the pin (PTA4), then my code do this. Each time that you press the SW3, it will trigger a data (4 bytes) transfer, as the size buffer (sizeof(srcAddr)) is 4 data, then after 4 requests, it will go to the callback and it will start again.
Now, I have checked your application, if you require a SPI data transfer, then you need a peripheral to memory transfer type, and manage the request by SPI RX. Still you don't need to implement scatter gatter feature. let me explain.
Your will generate DataReady signals at a periodic time, this signal have to inform your K64 that it has to start transfer data, so K64 has to start the communication, and just until data has arrived to SPI data buffer (SPIx_RXFRn), your SPI will generate a RX FIFO drain request that will trigger DMA, and this will transfer data from SPI data buffer to internal memory (so kEDMA_PeripheralToMemory).
This implementation is already in the fsl_edma_spi driver, which you can see in the dspi_edma_b2b_transfer_master example. The only part here that you need to implement is to manage the DataReady signal, but this signal can be managed as a GPIO interrupt and inside the handler, put a Master Start transfer.
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------