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.

 

版权声明:本文为CSDN博主「elikang」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/elikang/article/details/122726736

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.

 

版权声明:本文为CSDN博主「elikang」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/elikang/article/details/122726736

生成海报
点赞 0

elikang

我还没有学会写个人说明!

暂无评论

相关推荐

MCU串行通讯和并行通讯的区别以及UART的理解

假如我们需要从一个MCU发送一段数据到另一个MCU,我们可以选择两种通信方式,串行通信或者并行通信。 假如我们要发送的数据是数字198转化为二进制,就是11000110,如果使用串行通信