AnsweredAssumed Answered

Issue with using eDMA for CSI data transfer on imx rt1050

Question asked by Stephanie Kwan on Jun 22, 2018
Latest reply on Jul 12, 2018 by CarlosCasillas

Hi, 

I am trying to use the eDMA (for example DMA0) to tranfer CSI data to some specific data buffers in memory instead of using the 2 CSI DMA controllers but is having trouble with the transfer.

 

I  setup the CSI config and eDMA config and transfer as follows

 

/* Set up the CSI */

CSI_Init(CSI, &csiConfig);

 

/* Set up the DMA & DMAMux */
DMAMUX_Init(DMAMUX);
DMAMUX_SetSource(DMAMUX, DMA_CSIRX_CHAN, kDmaRequestMuxCSI);
DMAMUX_EnableChannel(DMAMUX, DMA_CSIRX_CHAN);

EDMA_GetDefaultConfig(&edmaConfig);
EDMA_Init(DMA0, &edmaConfig);
EDMA_CreateHandle(&edmaRxHandle, DMA0, DMA_CSIRX_CHAN);
EDMA_SetCallback(&edmaRxHandle, EDMA_Callback, NULL);

 

/* Prepare and start EDMA transfer */
EDMA_PrepareTransfer(&transferConfig, (void *)CSI_RXFIFO_ADDR, sizeof(uint32_t), (void *)&customBuffer[buff_idx], sizeof(uint32_t), 32, BUFFER_LENGTH,kEDMA_PeripheralToMemory);

assert(EDMA_SubmitTransfer(&edmaRxHandle, &transferConfig) == kStatus_Success);
EDMA_EnableChannelInterrupts(edmaRxHandle.base, edmaRxHandle.channel,
kEDMA_MajorInterruptEnable);

EDMA_StartTransfer(&edmaRxHandle);

 

/* Enable CSI interrupt and CSI */

CSI_EnableInterrupts(CSI,  kCSI_RxFifoFullInterruptEnable );

csiEnable(CSI); // just set the CSI enable bit in CSICR18

 

 

As a test, the CSI interface should send an incrementing pattern. However, when I inspect data the data that I received in the custom buffer, I see the custom buffer is filled, but the data is not the incrementing pattern. Instead there are only 2 unique words in the data.

 

Is something in my EDMA configuration that is set incorrectly?

 

Thanks,

Stephanie

Outcomes