HAL_ADC_ConvHalfCpltCallback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-04-02 3:07 PM
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!
- Labels:
-
STM32CubeIDE
