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?
Asked
Active
Viewed 5,233 times
6
-
1Based on this brief sentence "When the program reaches a breakpoint, internal peripherals like timers can be frozen in their current state or can be left running." from this [doc](http://www.st.com/content/ccc/resource/training/technical/product_training/16/31/0e/0d/94/11/4f/5e/STM32L4_System_Debug.pdf/files/STM32L4_System_Debug.pdf/jcr:content/translations/en.STM32L4_System_Debug.pdf), so it depends. I do not know where can you tell the debugger to froze certain peripherals. – Bence Kaulics Apr 04 '17 at 11:58
-
Lookup the DGBMCU on here or google. On the STM32 you can generally have a choice if you want to stop a peripheral when the debugger stops. I found plenty of examples after a quick search. The STM HAL provides an interface if you need code examples. – Realtime Rik Apr 04 '17 at 12:22
1 Answers
10
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.

veeman
- 780
- 1
- 8
- 17