DMA transfer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA transfer

4,020 Views
stabilo
Contributor II

Dear support team,

 

I come to you to know if you have example project of a simple DMA transfer on the microcontroller S32K144 ?

 

In the future, the ADC COCO flag will be used as DMA request, but for the moment I just would like to implement  a single 16 bit transfer trigged by software from the source to the destination.

 

Can you please help me ? (I can send you my test code)

 

Thanks.

Labels (1)
Tags (2)
0 Kudos
7 Replies

2,697 Views
stabilo
Contributor II

Ok it is working ! Now I'm trying to generate the "transfer complete" interrupt. I set the INTMAJOR bit to 1 and the DMA0 interrupt is enabled in the NVIC. I use the DMA to transfer 2 bytes, the transfer is done but the DONE flag is never set and so the interrupt is never generated. Can you help me please ?

0 Kudos

2,697 Views
PetrS
NXP TechSupport
NXP TechSupport

I posted DMA example here https://community.nxp.com/docs/DOC-333054 

BR, Petr

0 Kudos

2,697 Views
stabilo
Contributor II

Hi,

I made a code that read the ADC0 and transfer the data using the DMA channel 0. I can trigger the DMA by software, like in our example code, but now I would like to trigger the DMA channel with the ADC0_COCO flag.

- I've configured the ADC channel to enable the DMA request (DMAEN);

- I've configured the DMAMUX channel with this code :

void AdcInitDMAMUX (void)
{
  PCC_DMAMUX0 |= PCC_IP_CGC(1);                                      /* Enabling the clock on ADC1 channel */
  DMAMUX_CHCFG0 &= ~ DMAMUX_CHCFG_ENBL(1);         /* Disabling the DMA channel */
  DMAMUX_CHCFG0 |= DMAMUX_CHCFG_SOURCE(40);     /* ADC0 COCO is the source of the DMA0 channel */
  DMAMUX_CHCFG0 |= DMAMUX_CHCFG_ENBL(1);             /* Enabling the DMA channel */
}

- The configuration of the DMA channel is quite the same as in the example.

This is not working, the ADC0_COCO flag is set, but the DMA channel isn't triggered (when I use a software trigger, the DMA transfers the datas).

Dit I forget something to use the ADC_COCO to trigger the DMA ?

Thank you.

0 Kudos

2,697 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you should also enable DMA request signal for the corresponding DMA channel within DMA_ERQ register. Set respective bit in this ERQ register or use the DMA_SERQ register for that.

BR, Petr

0 Kudos

2,697 Views
stabilo
Contributor II

Thank you for your fast response, indeed, I forgot to enable the the DMA request signal in DMA_ERQ, but it is still not working. I really don't know what is the problem here ...

Tkank you for your help

0 Kudos

2,697 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I posted simple code here: Example S32K144 DMA memory copy test S32DS 

BR, Petr

0 Kudos

2,697 Views
stabilo
Contributor II

Thank you !

0 Kudos