问题
Debugger can stop execution of code in Cortex when it reaches a breakpoint or user pauses the execurion of code. But does debugger freeze other periphirals like DMA, UART and TIMERS when cortex stops execuring the code in pause state?
回答1:
You can only hold time/r depend peripherals.
I call the following code on entering the main function:
DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM2_STOP | DBGMCU_APB1_FZ_DBG_TIM3_STOP |
DBGMCU_APB1_FZ_DBG_TIM4_STOP | DBGMCU_APB1_FZ_DBG_TIM5_STOP);
DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM19_STOP);
This stops several timers if your code hit a breakpoint. If your DMA transactions depends on the specified timer (like mine) it will also implicitly stop otherwise not.
来源:https://stackoverflow.com/questions/43204687/stm32-freezing-periphirals-when-pausing-the-debugger