STM32 Freezing periphirals when pausing the debugger

て烟熏妆下的殇ゞ 提交于 2020-06-14 08:35:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!