cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 Output of ADC on multiple channels with DMA is abnormal

LittleYe233
Associate II

I am trying to use ADC with DMA on STM32H743XI. I set up ADC1 IN7~IN9 and use three uint16_t to store their converted values. I use DMA2 Stream 0 to transfer data. CPU ICache and DCache as well as MPU are disabled. ADC Clock Mux is set to PLL2P 50MHz. SYSCLK is set to 480MHz. I also set up a USART1 to print results.

Below are some other settings on STM32CubeMX:

ADC settings:

LittleYe233_0-1725286242200.png

ADC DMA settings:

LittleYe233_1-1725286297830.png

This is how I define the result array:

uint16_t ADC_Values[ADC_N_CHANNELS] __attribute__((section(".ARM.__at_0x24000000")));

where `ADC_N_CHANNELS` is 3.

After initializing peripherals, I add the code below to the main function above the infinite while loop:

HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)ADC_Values, ADC_N_CHANNELS);

In the while loop I print the values of `ADC_Values` and delay for a sec. But it seems that the values of the array are always over 10,000, which are obviously abnormal. What's wrong with it? Any help will be highly appreciated.

2 REPLIES 2
SofLit
ST Employee

Hello,

I think you need to give more details and more code or if possible to attach your project.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

> But it seems that the values of the array are always over 10,000, which are obviously abnormal.

Why would that be obvious?

What is connected to the respective pins?

What hardware are you using, a "known good" board like Nucleo/Disco, or your own?

How are those pins set (i.e. read out and check/post relevant GPIO registers content)?

JW