Skip to main content
msche.1
Associate III
February 17, 2022
Solved

STM32MP1 DMA buffer not populating with ADC values.

  • February 17, 2022
  • 1 reply
  • 1157 views
/* USER CODE BEGIN PD */
#define ADC_BUF_LEN 4096
/* USER CODE END PD */
 
...
 
/* USER CODE BEGIN PV */
uint16_t adc_buf[ADC_BUF_LEN];
 
...
/* USER CODE BEGIN 2 */
HAL_ADC_Start_DMA(&hadc2, (uint32_t*)adc_buf, ADC_BUF_LEN);

I've got the above code added to my project with the attached IOC, but when I hit a debug breakpoint after a second or so there are no values in the adc_buf.

In addition, when I probe the ANA1 (Arduino Pin A3) with nothing plugged in, I get a sine wave that sits offset at ~3v and has a peak to peak voltage of about 800mV and 128MHz frequency. See pic below.

0693W00000KZcATQA1.png It's also notable that there is no "DMA Continuous Requests" option in Parameter Settings which I understand I need to set to Enabled.

This topic has been closed for replies.
Best answer by msche.1

Well I finally found settings and code that worked. Not really sure what I did, but these are my configs for anyone else who's looking to do this.

0693W00000KZcN3QAL.png0693W00000KZcMyQAL.png

1 reply

msche.1
msche.1AuthorBest answer
Associate III
February 18, 2022

Well I finally found settings and code that worked. Not really sure what I did, but these are my configs for anyone else who's looking to do this.

0693W00000KZcN3QAL.png0693W00000KZcMyQAL.png