Ubuntu22.04, 使用WCH-LinkE通過openocd操作提示Hart 0 unexpectedly reset

環(huán)境:

Ubuntu22.04

WCH定制的openocd, 解壓自?MRS_Toolchain_Linux_x64_V1.60.tar.xz

CH32V003F4P6開發(fā)板

WCH-LinkE


連接:

3V3? -> VCC

GND -> GND

SWDIO -> PD1


問題:

已經(jīng)按壓縮包中的readme, 將動(dòng)態(tài)鏈接庫和udev權(quán)限配置好, openocd能正常運(yùn)行,?


./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-LinkE-CH32V307? mod:RV version 2.7?

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=0x40800014

[riscv.cpu.0] Target successfully examined.

Info : starting gdb server for riscv.cpu.0 on 3333

Info : Listening on port 3333 for gdb connections


但是在操作CH32V003時(shí)報(bào)錯(cuò):


擦寫


./openocd -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last" -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-LinkE-CH32V307? mod:RV version 2.7?

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=0x40800014

[riscv.cpu.0] Target successfully examined.

Info : starting gdb server for riscv.cpu.0 on 3333

Info : Listening on port 3333 for gdb connections

Info : device id = 0x17a8abcd

Info : flash size = 16kbytes

Info : Hart 0 unexpectedly reset!

erased sectors 0 through 15 on flash bank 0 in 0.022614s



燒錄

./openocd -f wch-riscv.cfg -c init -c halt -c "program /home/mil/ch32v003-template/Build/app.elf" -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-LinkE-CH32V307? mod:RV version 2.7?

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=0x40800014

[riscv.cpu.0] Target successfully examined.

Info : starting gdb server for riscv.cpu.0 on 3333

Info : Listening on port 3333 for gdb connections

Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)

Warn : Bypassing JTAG setup events due to errors

** Programming Started **

Info : device id = 0x17a8abcd

Info : flash size = 16kbytes

Info : Hart 0 unexpectedly reset!

** Programming Finished **


這會(huì)是什么原因?


您好,您說的這個(gè)信息是info開頭的提示信息,實(shí)際命令行的擦除和燒寫操作指令應(yīng)該已經(jīng)正常完成了,這個(gè)是可以通過程序是否運(yùn)行來驗(yàn)證的。


檢查了一下, 確實(shí)擦寫和燒錄是成功的, 之前寫入了但是沒運(yùn)行


但是 Hart 0 unexpectedly reset! 這樣的輸出是不是有誤導(dǎo)的嫌疑


應(yīng)該給研發(fā)提一個(gè)bug?


另外,wlink_reset_resume 這個(gè)參數(shù)是不是廢棄了 -c wlink_reset_resume 并不重啟芯片, 測試了很多遍, 只有使用-c reset -c resume 這樣的組合才能重啟芯片


您好,感謝您的反饋。wlink_reset_resume沒有廢棄,但目前在linux下表現(xiàn)的效果是復(fù)位后暫停,沒有運(yùn)行,現(xiàn)版本可在其后在加一條-c resume來恢復(fù)執(zhí)行。 后續(xù)我們會(huì)盡快更正此問題。


好的, 再請教一個(gè)問題,??wlink_reset_resume 和 reset 這兩個(gè)參數(shù)有什么區(qū)別嗎? 觀察到的效果都是重啟


reset 內(nèi)核復(fù)位,只復(fù)位內(nèi)核寄存器。wlink_reset_resume 軟件復(fù)位不僅復(fù)位內(nèi)核寄存器,代碼重新跑,所有外設(shè)也復(fù)位。


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频