cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G474 ADC Communication question

KBae.1
Associate

hello.

I would like to ask a question about the ADC capabilities of the STM32G474.

To use ADC, use the HAL_ADC_Start_DMA function.

HAL_ADC_Start_DMA(&hadc1, (uint32_t *)&DATA,1);

Here, I know that the third parameter is the number of data to receive.

I want to do a callback after receiving one piece of data here.

uint32_t DATA;

HAL_ADC_Start_DMA(&hadc1, (uint32_t *)&DATA,1);

=> It doesn't work.

uint32_t DATA[2];

HAL_ADC_Start_DMA(&hadc1, DATA,2);

=> works

However, if you implement and operate to receive only one data, it will not work.

It works only when it receives two or more data as shown below.

I'd like to know what part of the problem is.

0 REPLIES 0