STM32、GD32 JTAG/SWD禁用(烧录失败)解决方法总结

MCU烧录失败,有一种情况是JTAG/SW接口被禁用导致的。

通常是由于程序编写过程中关闭了JTAG/SW接口,或者JTAG/SW接口的引脚被有意无意地复用为其它功能了。这时候想要解决这个问题,核心就是让MCU上电启动的时候不要运行主Flash里面的程序,这样MCU的JTAG/SW接口就不会被干扰到,从而实现正常烧录。

方法一:

把BOOT0短接3.3V,再烧写就可以工作了,之后再用SWD烧录,无需再短接3.3V和BOOT0。

方法二:

Keil下设置 :Options → Debug → Use → Settings → Debug → Connect & Reset Options → Connect → under Reset 。

其它IDE下可以在设置里面找到相应的设置,实现同样的效果。

具体解释可以查看下面的链接:ULINK2 User's Guide: Debug

Connect & Reset Options

 control the instructions executed while connecting to target.

Connect

 - controls the operations that are executed when the µVision debugger connects to the target device. The drop-down has the following options:


Normal just stops the CPU at the currently executed instruction after connecting.
with Pre-reset applies a hardware reset(HW RESET) before connecting to the device.
under Reset holds the hardware reset(HW RESET) signal active while connecting to the device. Use this option when the user program disables the JTAG/SW interface by mistake.
without Stop connects to and disconnects from the target device without explicitly stopping the CPU. Use this option, for example, to inspect memory or peripheral SFRs.


 

  • 11
    点赞
  • 68
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值