You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

STM32G050F6P6 PCB编程调试异常,请求排查接线问题

STM32G050F6P6 PCB编程调试问题排查

问题背景

  • 自制PCB上的STM32G050F6P6无法正常进行编程与调试,多方咨询未找到有效解决方案
  • 核心现象:STM32Programmer可通过.elf文件正常烧录MCU,但使用STM32Cube IDE上传代码或调试时异常;已尝试调整所有相关调试、上传配置,均无效
  • 调整措施:将MCU引脚与ST-LINK/V2的SWDIO、SWCLK连接器之间的电阻从1kΩ更换为20Ω后,可进入SWD模式调试(支持复位下连接或软件系统复位,调试时钟950kHz),但仍存在报错

错误信息

调试界面错误截图

调试错误弹窗

OpenOCD日志输出

Open On-Chip Debugger 0.11.0+dev-00449-g53fa0f7 (2022-06-09-09:42) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J40S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.208388
Info : clock speed 950 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x0bc11477
Info : STM32G050F6Px.cpu: Cortex-M0+ r0p1 processor detected
Info : STM32G050F6Px.cpu: target has 4 breakpoints, 2 watchpoints
Info : STM32G050F6Px.cpu: external reset detected
Info : starting gdb server for STM32G050F6Px.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : device idcode = 0x10006456 (STM32G05/G06xx - Rev A : 0x1000)
Info : RDP level 0 (0xAA)
Info : flash size = 32kbytes
Info : flash mode : single-bank
Error: Failed to read memory at 0xfffffffe
Error: Failed to read memory at 0xfffffffe
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : Padding image section 0 at 0x080018c4 with 4 bytes (bank write end alignment)
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : STM32G050F6Px.cpu: external reset detected

疑问与待排查点

更换SWDIO和SWCLK线路上的1kΩ电阻(R14、R15)为20Ω后出现上述报错,怀疑接线存在问题。编程部分接线图如下,是否存在接线遗漏或错误?

编程部分接线图


内容的提问来源于stack exchange,提问作者Francesco Crevatin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 06:25:22