cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 ADC DMA (PF7/PF8/PF9/PF10)

SSchn.8
Associate II

Greetings,

Platform Details:

  • GCC 10.3 + CMake
  • STM32H723 Nucleo-144

I am currently a bit struggling with the ADC Conversion via DMA. My software is working with many other ADCs, but for some reasons, if I am using following ADCs, the values from the DMA-Controller do remain zero, even though the DMA transmission has been successfully finished:

  • PF7: ADC3_INP3
  • PF8: ADC3_INP7
  • PF9: ADC3_INP2
  • PF10: ADC3_INP6

If I replacing PF7 with PF6 it seems to work again as expected, therefore I don't expect any bugs from my side. Are there any known issues with the DMA controller related to those pins?

Kind regards

6 REPLIES 6
TDK
Guru

The DMA transfers data from the peripheral (ADC->DR register) to memory. It doesn't do anything with specific pins. The answer is likely elsewhere.

If you feel a post has answered your question, please click "Accept as Solution".

So could you explain me then why other ADC3 Channels are working fine via DMA? I have not forgotten to configure the Channel. I also checked the Auto generated Code.

Even though the Pins PF7-PF10 would be grounded, i would at least expect some noise but each conversion is returning exactly 0 which is really strange because those pins are currently floating.

> each conversion is returning exactly 0

How do you know? Did you observe the ADC registers' content?

JW

I don't know, probably a bug in your code or a misunderstanding in your interpretation of the results. You haven't posted anything to be able to diagnose.

> each conversion is returning exactly 0 which is really strange because those pins are currently floating.

Taking ADC conversions on pins that are floating and then attributing significance or importance to the result is not advised.

If you feel a post has answered your question, please click "Accept as Solution".
SSchn.8
Associate II

0693W00000GZDG6QAP.png0693W00000GZDFmQAP.png0693W00000GZDFhQAP.png0693W00000GZDFcQAP.png0693W00000GZDF9QAP.png0693W00000GZDFNQA5.png0693W00000GZDFDQA5.png0693W00000GZDF3QAP.pngHere some more details. You can find the necessary DMA + ADC Configuration. I am using a std::vector to handle the incoming DMA Data. You can find a snippet of the local data in the "HAL_ADC_Start_DMA" Function (I am using the addresses 0x3000 0000 and above for the DMA transmission). @Community member​ . In the Memory View you can see, that only certain memory areas are being updated (The red ones). Channel 2, 3, 6 and 7 remain zero. All channels which are before/after are working as expected.

I don't change any CubeMX Configuration, I am just using the created source code and using the HAL-Handles in my application code.

Any idea what the issue might be?

> I am using a std::vector to handle the incoming DMA Data.

I don't use C++ and don't know what exactly this means, but dynamically allocated and re-allocated memory sounds like a potential source of problems.

Try conservative static DMA buffer allocation.

JW