AnsweredAssumed Answered

ADC1 DMA Scan Conversions Start at Wrong Array Index Every Other Scan

Question asked by Stephen on Apr 13, 2016
Latest reply on Apr 13, 2016 by FTITI.Walid
I have an ADC1 buffer that is being filled by DMA once every time on this call:

HAL_ADC_Start_DMA( &hadc1, (uint32_t *)ADC_Data, 3 );


uint16_t ADC_Data[] = { 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF }; 

I can tell by the initialized values that ADC_Data[3] never gets a conversion as expected.

What is not expected is that the array element that gets the first conversion of the scan is changing. It is alternating between ADC_Data[0] and ADC_Data[1] every call to HAL_ADC_Start_DMA(). When it is ADC_Data[1] the last of the three conversions gets wrapped around to ADC_Data[0]. Why is it starting at ADC_Data[1] every other scan instead of always at ADC_Data[0] as expected? I need it to always start at ADC_Data[0].

The configuration code is in the attached file.

This is an STM32CubeMX generated project for an STM32F373VCT processor.