cancel
Showing results for 
Search instead for 
Did you mean: 

ADC3(+DMA) not working when using UART4(+DMA)

Johann Roesch
Associate II
Posted on July 09, 2018 at 16:46

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
3 REPLIES 3
Posted on July 09, 2018 at 17:55

>>Why is the ADC3 with DMA not working anymore when using the same DMA unit (but different channel of course) additionally for transferring UART4-Tx?

Is the UART4 DMA generating an interrupt, and is that being properly serviced? The CM4 will keep re-entering the IRQ Handler in the cause isn't cleared.

If you stop in a debugger where is it stuck?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Johann Roesch
Associate II
Posted on July 10, 2018 at 07:38

Hi Clive, thanks for reply.

Is the UART4 DMA generating an interrupt, and is that being properly serviced?

In this example project which I showed you its implementation isn't even finished. I just want to show you that this line

LL_DMA_SetPeriphRequest(DMA2, LL_DMA_CHANNEL_3, LL_DMA_REQUEST_2);

which sets the hardware request, seems to be responsible that the ADC3-DMA-Interrupt doesn't work anymore.

I have some additional information:

In a different project, I have set the ADC3 result transfer on DMA1CH3, and UART4 is still on DMA2CH3. This works!

But when switching from DMA1CH3 to DMA2CH5 its not working anymore!

The problem is, that I have to set it to DMA2CH5 because I need DMA1CH3 for a different hardware.

If you stop in a debugger where is it stuck?

Its stuck in the main while loop. And it does not start AD conversion anymore, since the ADSTART bit keeps being '1', which means

that the ADC is operating and eventually converting a regular channel. (Reference manual)

Posted on July 11, 2018 at 17:44

I had a look in the Errata Sheet. It says

DMA2 channels 2 and 3 (respectively) cannot be used when the ADC2 and ADC3 requests are selected on DMA2 channels 4 and 5

This answers my question!