Skip to main content
Visitor II
April 11, 2024
Solved

STM32F4VET6 DMA ADC half callback after buffer is full

  • April 11, 2024
  • 1 reply
  • 910 views

So,I set my DMA at circular mode ,adc at continuous mode ,but when I debug the timing to get into HAL_ADC_ConvHalfCpltCallback(),I found the buffer is already fulled,can someone tell me what's going on?

Best answer by mƎALLEm

Hello,

Because it's not possible to stop ADC while debugging. See this thread.

The only solution I see, is to trigger the ADC with a timer and freeze its counting when the CPU is halted. This is done by writing to DBGMCU_APB2_FZ register:

SofLit_0-1712841049954.png

See this thread.

Hope it helps.

1 reply

mƎALLEm
mƎALLEmBest answer
Technical Moderator
April 11, 2024

Hello,

Because it's not possible to stop ADC while debugging. See this thread.

The only solution I see, is to trigger the ADC with a timer and freeze its counting when the CPU is halted. This is done by writing to DBGMCU_APB2_FZ register:

SofLit_0-1712841049954.png

See this thread.

Hope it helps.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.