AnsweredAssumed Answered

DMA triggered by a GPIO

Question asked by Mikael Elharrar on Jul 13, 2017
Latest reply on Jul 13, 2017 by Mark Butcher

Hi community,

 

It is the third ticket I open.

I dont succedded to work with gpio trigger on DMA.

I'm using Kinetis K64 + SDK 2.1.

 

I wrote a minimalist example, with a very simple memory to memory DMA transfer.

When I start it explicitly with EDMA_StartTransfer(&g_EDMA_Handle) so all is OK and I get the interrupt notification at the end of the transfer.

 

But when I configured my GPIO pin to be a trigger ( like that):

    PORT_SetPinInterruptConfig(ADS_PORT, N_DRDY_PIN, kPORT_DMAFallingEdge);
    PORT_SetPinMux(ADS_PORT, N_DRDY_PIN, kPORT_MuxAsGpio);
    GPIO_PinInit(ADC_GPIO, N_DRDY_PIN, &config);

   EnableIRQ(ADC_PORT_IRQ);

 

and the DMAMUX0 like:

    DMAMUX_Init(DMAMUX0);
    DMAMUX_SetSource(DMAMUX0, 0, kDmaRequestMux0PortD);
    DMAMUX_EnableChannel(DMAMUX0, 0);

 

    EDMA_GetDefaultConfig(&userConfig);
    EDMA_Init(DMA0, &userConfig);
    EDMA_CreateHandle(&g_EDMA_Handle, DMA0, 0);
    EDMA_SetCallback(&g_EDMA_Handle, _edma_cb, NULL);
    EDMA_PrepareTransfer(&transferConfig, srcAddr, sizeof(srcAddr[0]), destAddr, sizeof(destAddr[0]),
                             sizeof(srcAddr[0]), sizeof(srcAddr), kEDMA_MemoryToMemory);
    EDMA_SubmitTransfer(&g_EDMA_Handle, &transferConfig);

 

It doesnt work me at all ....

Note that I checked with scope the interrupts and this is working.

Where should be configured the trigger please.

Please help.

I don't found in the datasheet how the DMA can be hardware triggered. The only trigger the datasheet talks is in DMAMUX.

 

Thanks

Outcomes