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

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

问题描述

当调试器到达断点或用户暂停执行代码时,可以停止在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?

推荐答案

您只能容纳时间/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天全站免登陆