求助 => buntu 22.04 WCH-LinkE openocd 无法使用

OS:ubuntu 22.04

openocd: WCH 特别版本,如下

$ ./openocd --version
   Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-10-10-10:35)
   Licensed under GNU GPL v2
   For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html


原有的 WCH-Link 可正常运行 openocd,如下

装置检查

$ lsusb

Bus 001 Device 041: ID 1a86:8010 QinHeng Electronics WCH-Link

$ ls -la /dev/bus/usb/001/041
crw-rw----+ 1 root plugdev 189, 40  3月 12 16:50 /dev/bus/usb/001/041

运行 openocd

$ ./openocd -f wch-riscv.cfg -c init -c halt -c exit
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-10-10-10:35)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.8
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x0
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
可正常运行

======= 分割线 =======

新购买 WCH-LinkE (为了 CH32V003F4P6 开发)

装置检查

$ lsusb

Bus 001 Device 042: ID 1a86:8010 QinHeng Electronics WCH-Link

$ ls -la /dev/bus/usb/001/042
crw-rw----+ 1 root plugdev 189, 40  3月 12 16:50 /dev/bus/usb/001/042

运行 openocd

$ ./openocd -f wch-riscv.cfg -c init -c halt -c exit

Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-10-10-10:35)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Error: unknow WCH-LINK


请问是哪里出了问题 ?


用这个:https://github.com/karlp/openocd-hacks


自行编译安装,然后这样使用:


openocd -f interface/wlink.cfg -f target/wch-riscv.cfg -c "program yourprogram.hex" -c wlink_reset_resume -c exit


Ubuntu22.04, Wch-LinkE, CH32v003,亲测可用。


只有登录才能回复,可以选择微信账号登录