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

生成海报
点赞 0

elikang

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

暂无评论

发表评论

相关推荐

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

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

正点原子 例程学习记录 实验四 串口实验

断断续续地看了一阵子 ,一度被工程下无数的文件劝退,今又看了开发指南,发现其实没有编译的工程包含的文件并不多,绝大部分文件都是编译后才出现的。其中还有很多是系统文件,不需要自

stm32 EXIT外部中断及代码应用

先来了解一些基本概念 RCC外设,即复位和时钟控制的英文缩写,负责芯片的复位和时钟控制。 复位方式: 系统复位:系统复位将复位除时钟控制寄存器CSR中的复位标志和备份区域中的寄存器以