执行:
sudo ./openocd -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c exit
报错:
./openocd: symbol lookup error: ./openocd: undefined symbol: jaylink_device_get_usb_bus_ports
请问这是什么原因?怎么处理?
执行:
sudo ./openocd -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c exit
报错:
./openocd: symbol lookup error: ./openocd: undefined symbol: jaylink_device_get_usb_bus_ports
请问这是什么原因?怎么处理?
用的jlink?
是WCH-Link,
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 18f8:0f99 [Maxxter] Optical gaming mouse
Bus 001 Device 004: ID 1a86:8010 QinHeng Electronics WCH-Link
以前版本的MounRiver_Studio_Community_Linux中可以正常下载的,且windows下也正常下载。
您好,您可以用MounRiver_Studio_Community_Linux先下载一下,然后在MounRiver_Studio_Community_Linux目录下toolchain\OpenOCD\bin 使用相关指令试一下。
以前正常的命令行显示:
@font-face{ font-family:"Times New Roman"; }@font-face{ font-family:"宋体"; }@font-face{ font-family:"Calibri"; }@font-face{ font-family:"Monospace"; }p.MsoNormal{ mso-style-name:正文; mso-style-parent:""; margin:0; margin-bottom:0; text-align:justify; text-justify:inter-ideograph; font-family:Calibri; mso-fareast-font-family:宋体; font-size:14px; mso-font-kerning:1px; }span.msoIns{ mso-style-type:export-only; mso-style-name:""; text-decoration:underline; text-underline:single; color:blue; }span.msoDel{ mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red; }div.Section0{page:Section0;}
------------ Begin flash process of "obj/CH573F.hex" ------------
13:30:29:709 >> Current project vendor is WCH, target link is WCH-Link
13:30:29:709 >> Starting to Open Link in RISC-V APP mode...
13:30:29:717 >> Open Link in RISC-V APP mode Success
13:30:29:717 >> Starting to get link mode...
13:30:29:717 >> Link is under APP mode
13:30:29:717 >> Starting to compare firmware version...
13:30:29:717 >> Already the latest version. No need to update. Version is v2.1.
13:30:29:718 >> Starting to Close Link...
13:30:29:718 >> Close Link Success
13:30:29:718 >> Starting to Erase All...
"/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "flash erase_sector wch_riscv 0 last" -c exit
Open On-Chip Debugger 0.10.0+dev-gb0ae840-dirty (2021-09-03-23:07)
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 version 2.1
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x20000001 (mfg: 0x000 (), part: 0x0000, ver: 0x2)
Warn : Bypassing JTAG setup events due to errors
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101105
Info : Listening on port 3333 for gdb connections
Info : device id = 0x20000410
erased sectors 0 through 511 on flash bank 0 in 0.296227s
13:30:30:553 >> Starting to Download...
"/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "program \"/home/abc/MounRiver Studio/workspace/CH573F/obj/CH573F.hex\" 0x08000000" -c exit
Open On-Chip Debugger 0.10.0+dev-gb0ae840-dirty (2021-09-03-23:07)
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 version 2.1
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x20000001 (mfg: 0x000 (), part: 0x0000, ver: 0x2)
Warn : Bypassing JTAG setup events due to errors
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101105
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: riscv.cpu tap/device found: 0x20000001 (mfg: 0x000 (), part: 0x0000, ver: 0x2)
Warn : Bypassing JTAG setup events due to errors
** Programming Started **
Info : device id = 0x20000410
** Programming Finished **
13:30:33:085 >> Starting to Verify...
"/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "verify_image \"/home/abc/MounRiver Studio/workspace/CH573F/obj/CH573F.hex\"" -c exit
Open On-Chip Debugger 0.10.0+dev-gb0ae840-dirty (2021-09-03-23:07)
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 version 2.1
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x20000001 (mfg: 0x000 (), part: 0x0000, ver: 0x2)
Warn : Bypassing JTAG setup events due to errors
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101105
Info : Listening on port 3333 for gdb connections
Info : Verify Success
13:30:34:390 >> Starting to Reset...
"/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MounRiver Studio/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c reset -c exit
Open On-Chip Debugger 0.10.0+dev-gb0ae840-dirty (2021-09-03-23:07)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : WCH-Link version 2.1
Info : wlink_init ok
Info : reset success
------------------------------End -------------------------------
Operation Finished (took 4s.732ms)
现在不正常的命令行显示:
@font-face{ font-family:"Times New Roman"; }@font-face{ font-family:"宋体"; }@font-face{ font-family:"Calibri"; }@font-face{ font-family:"Monospace"; }p.MsoNormal{ mso-style-name:正文; mso-style-parent:""; margin:0; margin-bottom:0; text-align:justify; text-justify:inter-ideograph; font-family:Calibri; mso-fareast-font-family:宋体; font-size:14px; mso-font-kerning:1px; }span.msoIns{ mso-style-type:export-only; mso-style-name:""; text-decoration:underline; text-underline:single; color:blue; }span.msoDel{ mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red; }div.Section0{page:Section0;}
------------ Begin flash process of "obj/CH573F.hex" ------------
13:47:18:532 >> Current project vendor is WCH, debugger is WCH-Link
13:47:18:532 >> Starting to Open Link in RISC-V APP mode...
13:47:18:538 >> Open Link in RISC-V APP mode Success
13:47:18:538 >> Starting to get link mode...
13:47:18:538 >> Link is under APP mode
13:47:18:538 >> Starting to compare firmware version...
13:47:18:539 >> No need to update. Already the latest version. Version is v2.3.
13:47:18:539 >> Starting to Close Link...
13:47:18:539 >> Close Link Success
13:47:18:540 >> Starting to Erase All...
"/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MRS_Community/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "flash erase_sector wch_riscv 0 last" -c exit
/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: symbol lookup error: /home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: undefined symbol: jaylink_device_get_usb_bus_ports
13:47:18:586 >> Starting to Download...
"/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MRS_Community/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "program \"/home/abc/MounRiver Studio/workspace/CH573F/obj/CH573F.hex\"" -c exit
/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: symbol lookup error: /home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: undefined symbol: jaylink_device_get_usb_bus_ports
13:47:18:597 >> Starting to Verify...
"/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MRS_Community/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c halt -c "verify_image \"/home/abc/MounRiver Studio/workspace/CH573F/obj/CH573F.hex\"" -c exit
/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: symbol lookup error: /home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: undefined symbol: jaylink_device_get_usb_bus_ports
13:47:18:604 >> Starting to Reset...
"/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd" -f "/home/abc/MRS_Community/toolchain/OpenOCD/bin/wch-riscv.cfg" -c init -c wlink_reset_resume -c exit
/home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: symbol lookup error: /home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd: undefined symbol: jaylink_device_get_usb_bus_ports
------------------------------End -------------------------------
Operation Finished (took 0s.79ms). Open debug interface has code leak risk.
After download, please close simulator-debug interface, enable code and data protection promptly.
您好,请执行下 ldd /home/abc/MRS_Community/toolchain/OpenOCD/bin/openocd,看下是否能找到所有的依赖库。有缺失的话搜索一下,添加到默认路径或者单独设置都可以