【vscode配置EIDE插件烧录调试STM32中遇到的问题记录】

一、遇到的问题

问题一

问题:使用OpenOCD里面的stlink烧录方式烧录时,出现烧录失败没反应的问题

配置
在这里插入图片描述

终端结尾输出

Open On-Chip Debugger 0.12.0-rc2-g7a1adfbec (2022-11-06-10:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.   
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.099104
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477  
in procedure 'program'
** OpenOCD init failed **

解决方法:修改stm32f1x.cfg 文件中的一行代码

1、找到文件位置

C:\Users\Administrator\.eide\tools\openocd_7a1adfbec_mingw32\share\openocd\scripts\target\stm32f1x.cfg

上面的 Administrator 要更换成 自己的用户名
2、打开文件,找到关键语句
在这里插入图片描述
3、修改语句内容
找到这个语句,将0x1ba01477 修改成 0x2ba01477 即可,保存关闭重新编译烧录就好了。

问题二

问题:烧录失败,程序卡住,编译和烧录显示不正常

1、有问题的编译终端输出
在这里插入图片描述
只有显示编译成功,没有输出其他的东西
2、有问题的烧录输出

Open On-Chip Debugger 0.12.0-rc2-g7a1adfbec (2022-11-06-10:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.   
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.099104
Info : [stm32f1x.cpu] Cortex-M3 r2p1 processor detected
Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
[stm32f1x.cpu] halted due to breakpoint, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000148 msp: 0x20000440
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000148 msp: 0x20000440
** Programming Started **
Error: couldn't open c:/Users/Administrator/Desktop/stm32_EIDE/RCT6/01_Project_demo/Projects/MDK-ARM/build/Template/std_103.hex
embedded:startup.tcl:1516: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1581
at file "embedded:startup.tcl", line 1516

上面其实就是最主要的一句,就是

Error: couldn't open c:/........./build/Template/std_103.hex

其实就是找不到头文件

解决方法:修改配置项即可

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

全局选项里面的 Use MicroLIB 勾选
链接器里面的不生成 Hex/Bin 文件 不勾选
然后点击右上角全部保存即可

1、没有问题的编译终端输出
在这里插入图片描述
2、没有问题的烧录输出

Open On-Chip Debugger 0.12.0-rc2-g7a1adfbec (2022-11-06-10:08)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.   
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.099104
Info : [stm32f1x.cpu] Cortex-M3 r2p1 processor detected      
Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections  
[stm32f1x.cpu] halted due to breakpoint, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000148 msp: 0x20000440
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000148 msp: 0x20000440
** Programming Started **
Info : device id = 0x000aa414
Info : flash size = 256 KiB
Warn : Adding extra erase range, 0x08001734 .. 0x080017ff        
** Programming Finished **
** Verify Started **      
** Verified OK **

二、总结

1、本人跟着配置的视频链接
2、本人参考的博客链接1
3、本人参考的博客链接2

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值