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
Hi Kwan,
You could refer to the following application notes that provide examples of CSI usage on i.MX RT family:
https://www.nxp.com/docs/en/application-note/AN12110.pdf
https://www.nxp.com/docs/en/application-note/AN12103.pdf
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Is using eDMA to get CSI data instead of DMA dedicated for CSI a supported feature?