cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152D ADC with DMA not working

anio1491
Associate II
Posted on July 08, 2016 at 11:49

Hello everyone,

I am implementing some code forSTM32L152D-Eval Board using CubeMX; I set up one ADC channel (on pin PF10) with DMA transfer, but I don't get any data after starting the DMA:

HAL_ADC_Start_DMA(&hadc, (uint32_t*) pData, LENGTH)

The pData buffer is empty, there is no data in the ADC->DR register (but the ADONS bit is set, so the ADC is on). I also set up the interrupts, the timers and the callback functions for the ADC. What else do I need to care about? Thank you, any idea would be very helpful! Best regards, Andreea #!stm32-!cubemx #adc-dma
1 REPLY 1
raptorhal2
Lead
Posted on July 08, 2016 at 16:15

I am guessing you are using the EVAL potentiometer, have checked it's output with a VO meter, have the appropriate jumper to PF10 set, are converting channel 31 and have adequate ADC sampling cycles to allow for the potentiometer impedance.

As you can see, your limited implementation description leaves much room for guesswork. I recommend comparing your code to the L152 Nucleo ADC_Sequencer  example, allowing for differences such as 1 vs many channels, etc.

In my opinion, using HAL for ADC DMA conversion is highly convoluted. Debug step through your library calls to see if everything is as expected.

Cheers, Hal