Skip to main content
Mohamed eleuche
Associate III
December 31, 2025
Solved

STM32F030 problem reading two ADC channels with DMA

  • December 31, 2025
  • 1 reply
  • 366 views

Hello, I am getting really frustrated with this issue for almost a week.

I am trying to read PA1 and PA4 in DMA but I get only the reading of one channel and not the other one! I tried everything and I also looked at all the example online. Please help.

 

Best answer by TDK

I get only the reading of one channel and not the other one!

Why do you think that is the case? What readings do you get and what do you expect instead? Be specific.

> uint32_t adcValues[100]

> hdma_adc.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;

This should be an array of uint16_t, not uint32_t.

1 reply

TDK
TDKBest answer
Super User
December 31, 2025

I get only the reading of one channel and not the other one!

Why do you think that is the case? What readings do you get and what do you expect instead? Be specific.

> uint32_t adcValues[100]

> hdma_adc.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;

This should be an array of uint16_t, not uint32_t.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Mohamed eleuche
Associate III
January 1, 2026

Hello TDK,

thank you for your interest.

I think there are some mistakes in my code (that's why I shared the 3 main files). If someone can be so kind to have a look or suggest a working example to look at.

in my array I get:

adcValues[0]= 200 , 

adcValues[1]= 0  ,

adcValues[2]= 190 , 

adcValues[3]= 0  ,

adcValues[4]= 201 , 

adcValues[5]= 0  ,

and so fourth ...

 

 

 

TDK
Super User
January 1, 2026

Did you correct the error I noted?

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