ADC Configuration, working with DMA through tresos on S32K144 mcl

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

ADC Configuration, working with DMA through tresos on S32K144 mcl

1,683 Views
alexeiguriev
Contributor I

I want to set up the ADC working with DMA through tresos.

Questions:

  1. When I try to set "Adc Transfer Type" - DMA, Tressos says: Dma channel with ADC source must be enabled in MCL for hardware unit 0.
    question: Is it possible to use the ADC through DMA without "DMA transfer complete" interruption?
  2. When the "DMA transfer complete" interruption is set, it always calls the interruption function, again and again without a new DMA transfer complete.
    question: How to fix it?
0 Kudos
4 Replies

1,640 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @alexeiguriev ,

Please check whether you have configured the DMA source and DMA Transfer completion User notification callback as follow:

-  DMA source: ADC0_COCO, DMA Transfer completion User notification: Adc_Adc12bsarv2_DmaTransferComplete0 

and/or:

- DMA source: ADC1_COCO, DMA Transfer completion User notification: Adc_Adc12bsarv2_DmaTransferComplete1

Regards,

Nam

0 Kudos

1,623 Views
alexeiguriev
Contributor I

Hello @namnguyenviet,

Can you please answer the question about configuration without "DMA transfer complete" interruption?

0 Kudos

1,609 Views
namnguyenviet
NXP Employee
NXP Employee

Hello @alexeiguriev ,

If you choose the method for AdcHWUnit as ADC_DMA, but without "DMA transfer complete" interruption, then you are not able to convert the ADC group in continuous mode, as the notification for group conversion completed, or even a group with a single channel can't be completed, as the SW will change the status of ADC group conversion in "DMA transfer complete" callback function.

I'm glad to hear that you can temporarily fix the issue, as your way to clear the DMA-> INT flag. However, I don't think this is a bug from MCAL driver, cause the INT clear flag is already done in MCL in Mcl_DmaProcessInterrupt() via this call: DMA_CLEAR_INT_REQ(). 

Please share me the ADC and MCL configurations, also how you called the ADC conversion sequence i in your application. We will see whether something was setting up incorrectly.

Regards,

Nam

0 Kudos

1,630 Views
alexeiguriev
Contributor I

Hello @namnguyenviet ,

The configuration is done like this.

DMA Config.png

I found the solution, inside Adc_Adc12bsarv2_DmaTransferComplete0, Has to be reset DMA->INT flags. And then works. I think this is a bug.

0 Kudos