cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4VET6 DMA ADC half callback after buffer is full

fufu
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
SofLit
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.