2016-07-08 02:49 AM
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
2016-07-08 07:15 AM
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