cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 DMA buffer not populating with ADC values.

msche.1
Associate III
/* 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.

1 ACCEPTED SOLUTION

Accepted Solutions
msche.1
Associate III

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

View solution in original post

1 REPLY 1
msche.1
Associate III

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