Skip to main content
Visitor II
April 2, 2025
Question

HAL_ADC_ConvHalfCpltCallback

  • April 2, 2025
  • 1 reply
  • 587 views

I'm a beginner working with the STM32 Nucleo-L4R5ZI-P board and trying to set up ADC with DMA to sample an audio signal into a buffer. However, my DMA callback functions like HAL_ADC_ConvCpltCallback() and HAL_ADC_ConvHalfCpltCallback() are never being triggered.

I’ve set up ADC1 with DMA in circular mode, enabled continuous conversion, and called HAL_ADC_Start_DMA() in main(). The DMA1 Channel1 global interrupt is enabled in NVIC, and __HAL_LINKDMA(&hadc1, DMA_Handle, hdma_adc1); is included in HAL_ADC_MspInit(). The DMA1_Channel1_IRQHandler() is present in stm32l4xx_it.c and calls HAL_DMA_IRQHandler(&hdma_adc1) as expected.

I also tried using a timer (TIM2 with TRGO on update event) to trigger the ADC instead of software start, but the callbacks still don’t fire. Checking the DMA CNDTR register during runtime shows that the buffer doesn’t appear to be filling. The callbacks only run if I call them manually, so it seems like the DMA or ADC isn’t being triggered properly.

Any help would be greatly appreciated — I’m still new to STM32 and CubeIDE, so it’s possible I’ve missed something small. Thanks!

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    April 7, 2025

    Hello @stmuser 

    Did you call HAL_ADCEx_Calibration_Start() before starting conversion please?

    Please refer to the examples Projects/NUCLEO-L4R5ZI/Examples/ADC/ADC_DMA_Transfer to configure your DMA.