Nixmd
Nixmd

Reputation: 845

STM32 Freezing periphirals when pausing the debugger

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?

Upvotes: 7

Views: 6232

Answers (1)

veeman
veeman

Reputation: 800

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.

Upvotes: 11

Related Questions