SPI Transaction with Auto DMA

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JuCh_3556216
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

Hi,

I've successfully configured and tested a SPI DMA producer to pass data from the SPI producer to a USB socket for consumption. That DMA is currently configured like this:

//Configure DMA for real time streaming channel

CyU3PDmaChannelConfig_t dmaConfig;

dmaConfig.size = 1024;

dmaConfig.count = 64;

dmaConfig.prodSckId = CY_U3P_LPP_SOCKET_SPI_PROD;

dmaConfig.consSckId = CY_U3P_UIB_SOCKET_CONS_1;

dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;

//Disable DMA callbacks

dmaConfig.prodHeader     = 0;

dmaConfig.prodFooter     = 0;

dmaConfig.consHeader     = 0;

dmaConfig.notification   = 0;

dmaConfig.cb             = NULL;

dmaConfig.prodAvailCount = 0;

status = CyU3PDmaChannelCreate(&StreamingChannel, CY_U3P_DMA_TYPE_AUTO, &dmaConfig)

With its current configuration, the DMA doesn't transmit anything (except 0x0000) when streaming. Is there a way to set up another DMA that transmits data stored in memory on the CPU while simultaneously transmitting the data acquired during the transaction over USB?

My code can be found in the BurstMode branch of this repository.

Thanks for your help!

0 Likes
1 Solution

Hello Juan,

- Create a MANUAL DMA channel between FX3 CPU Producer and SPI Consumer to transfer data from the CPU to the SPI interface.

- For the transfer of data from SPI interface to USB, create an AUTO DMA channel between SPI Producer and USB Consumer.

Best regards,

Srinath S

View solution in original post

0 Likes
6 Replies