cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F334 HAL DMA ADC Scan conversion not working

RichardS1
Associate II
Posted on October 09, 2017 at 20:26

Hello. 

In my project, I use the ADC configured in scan mode, as seen on this screenshot from STM32CubeMX:

0690X00000608XgQAI.png

and the DMA configured as follows:

0690X00000608XRQAY.png

The problem is that I can't get any data transferred from ADC to memory, when I call

volatile uint32_t ADC1ConvertedValues[2];

HAL_ADC_Start_DMA(&hadc1, (uint32_t*)ADC1ConvertedValues, 2);

When I open the peripheral view on Keil uVision I can see that the ADC is working properly and the conversions are happening.

Can you tell me where's the problem?

#stm32f344 #adc #dma-adc
3 REPLIES 3
RichardS1
Associate II
Posted on October 10, 2017 at 21:41

Bump

Posted on October 10, 2017 at 22:33

Wouldn't the samples be uint16_t ? (HALF WORD)

Is the DMA peripheral indicating an error?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 26, 2017 at 12:28

Hi Richard,

In the case of STM32F3, you can find some examples in STM32F3 FW package (can be downloaded here:

http://www.st.com/en/embedded-software/stm32cubef3.html)

.

You can find an example corresponding to your device 

STM32F334 here:

Using driver LL:

...\Projects\STM32F334R8-Nucleo\Examples_LL\ADC\ADC_SingleConversion_TriggerSW_DMA

And another example corresponding to device 

STM32F303 here:

Using driver HAL:

...\Projects\STM32F303RE-Nucleo\Examples\ADC\ADC_Sequencer

Note: In CubeMx, you can select LL driver driver under: 

Project Settings -> Advanced Settings -> Driver

Then, if you compare the examples versus your generated code, can you see what is the difference ?