2024-12-22 11:47 PM
Hi, I am trying to use a timer triggered ADC sampler with DMA and a complete conversion-triggered callback function. I followed this guide (https://www.youtube.com/watch?v=_K3GvQkyarg) while configuring my single pin (channel) input for ADC. Specifically,
ADC Settings:
ADC Regular Conversion Mode:
DMA Settings:
Timer Settings (this enables 10Hz timer with 138 MHz APB):
Initialization Code:
HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc1, (uint32_t *) adcData, 1);
HAL_TIM_Base_Start(&htim8);
However, HAL_ADC_ConvCpltCallback() was only triggered once, as shown by adding a breakpoint to the callback function. What is the reason that this callback is not triggered at every sample?
I have also seen this post (https://community.st.com/t5/stm32cubeide-mcus/hal-adc-convcpltcallback-only-called-once/td-p/637221) featuring similar problems and solution. This post uses "TIM auto-reload preload: Enable", different than the YouTube guide, but neither solved the problem.