暂停调试器时 STM32 冻结外围设备 [英] STM32 Freezing periphirals when pausing the debugger

查看:24
本文介绍了暂停调试器时 STM32 冻结外围设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调试器可以在到达断点或用户暂停代码执行时停止执行 Cortex 中的代码.但是,当 cortex 在暂停状态下停止执行代码时,调试器是否会冻结其他外围设备,例如 DMA、UART 和 TIMERS?

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?

推荐答案

你只能持有 time/r 依赖外设.

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);

如果您的代码遇到断点,这会停止多个计时器.如果您的 DMA 事务依赖于指定的计时器(如我的),它也会隐式停止,否则不会.

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.

这篇关于暂停调试器时 STM32 冻结外围设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆