wlink
wlink copied to clipboard
Error: USB error: Operation timed out on WCH-Link-CH549
Hi, I just got these WCH-Link-CH549.
Unfortunately, they come with old firmware (v1.05). So I updated to new firmware bundled with MRS zip file MounRiverStudio_Linux_X64_V220/MRS-linux-x64/resources/app/resources/linux/components/WCH/Others/Firmware_Link/default/WCH-Link_APP_IAP_RV.bin.
wlink --speed low flash build/ch582_blinky.bin
15:26:05 [INFO] Connected to WCH-Link v2.12(v32) (WCH-Link-CH549)
15:26:05 [INFO] Attached chip: CH582 [CH582] (ChipID: 0x82000000)
15:26:05 [WARN] The debug interface has been opened, there is a risk of code leakage.
15:26:05 [WARN] Please ensure that the debug interface has been closed before leaving factory!
15:26:05 [INFO] Read build/ch582_blinky.bin as Binary format
15:26:05 [INFO] Flashing 2964 bytes to 0x00000000
Error: USB error: Operation timed out
Caused by:
Operation timed out
I couln't find another firmware version.. If I could use another version let me know.
If it is related, I get similar error on WCH's openocd:
openocd -f /home/ajit/.local/opt/OpenOCD/OpenOCD/bin/wch-riscv.cfg -c 'init; halt; program build/ch582_blinky.bin; reset; wlink_reset_resume; exit;'
Open On-Chip Debugger 0.11.0+dev-02415-gfad123a16-dirty (2024-11-20-13:09)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'sdi'
Warn : Transport "sdi" was already selected
Ready for Remote Connections
Info : WCH-Link-CH549 mode:RV version 2.12
Warn : The debug interface has been opened,there is a risk of code leakage ,ensure that the debug interface has been closed before leaving factory !
Info : wlink_init ok
Info : clock speed 6000 kHz
Info : [wch_riscv.cpu.0] datacount=2 progbufsize=8
Info : [wch_riscv.cpu.0] Examined RISC-V core; found 1 harts
Info : [wch_riscv.cpu.0] XLEN=32, misa=0x40901125
[wch_riscv.cpu.0] Target successfully examined.
Info : starting gdb server for wch_riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
** Programming Started **
Info : flash size = 448kbytes
Error: libusb_bulk_read error: LIBUSB_ERROR_TIMEOUT
Error: error writing to flash at address 0x00000000 at offset 0x00000000
embedded:startup.tcl:1162: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1227
at file "embedded:startup.tcl", line 1162
Note that if I use a different probe it is working (different kind), so nothing wrong with the setup..
wlink flash build/ch582_blinky.bin
12:19:30 [INFO] Connected to WCH-Link v2.8(v28) (WCH-Link-CH549)
12:19:30 [INFO] Attached chip: CH582
12:19:30 [WARN] The debug interface has been opened, there is a risk of code leakage.
12:19:30 [WARN] Please ensure that the debug interface has been closed before leaving factory!
12:19:30 [INFO] Read build/ch582_blinky.bin as Binary format
12:19:30 [INFO] Flashing 2964 bytes to 0x00000000
███████████████████████████████████████████████████████████████████████████████████████████████████████████ 2964/296412:19:30 [INFO] Flash done
12:19:31 [INFO] Now reset...
It works now.. Downgraded to version 2.8 from here.
wlink --speed low flash build/ch582_blinky.bin
23:32:43 [INFO] Connected to WCH-Link v2.8(v28) (WCH-Link-CH549)
23:32:43 [INFO] Attached chip: CH582
23:32:43 [WARN] The debug interface has been opened, there is a risk of code leakage.
23:32:43 [WARN] Please ensure that the debug interface has been closed before leaving factory!
23:32:43 [INFO] Read build/ch582_blinky.bin as Binary format
23:32:43 [INFO] Flashing 2964 bytes to 0x00000000
███████████████████████████████████████████████████████████████████████████████████████████████████████████ 2964/296423:32:45 [INFO] Flash done
23:32:45 [INFO] Now reset...