Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 515
Nixmd Avatar asked Apr 04 '17 10:04

Nixmd


1 Answers

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.

like image 136
veeman Avatar answered Oct 14 '22 02:10

veeman