Closed lennyerik closed 1 year ago
I also ran into this problem. For me it happens when i send alot data through serialport on debugger. Unplugging the debugger clears the issue.
Curiously, based on my testing, the proprietary WCHLink-OpenOCD binary does not seem to have this issue at all. Perhaps they ignore the error or clear the cmderror queue too at some point?
Thanks for the report. I'll check this on my CH32V307 board later.
Resolved. "QingKeV2 Microprocessor Debug Manual" didn't mention a step used in openocd code to clear cmderr state.
@lennyerik Could you try the fixed version? It should be ready when nightly build released.
The fix also works on my board. :+1: Thanks for taking the time to look into this issue!
I have a CH32V307V-R1-1v0 devboard (second revision of the CH32V307 evaluation board) running WCH-Link 2.9 and am trying to flash it using wlink.
All operations supported by wlink (flashing, reading and writing registers, resetting, ...) seem to work fine on the first run after power-cycling the board. However, subsequent runs of the same command (especially when executing the same command multiple times in quick succession) sometimes result in the error
Error: DM Abstract comand error: Parity
.This issue occurs with all subcommands and I managed to track it down to this check in operations.rs. As I am not very familiar with the WCH-Link protocol, I'm not sure on what exactly could be causing this problem, although it looks to me like
read_reg
is called on chip initialisation somewhere and fails sometimes becauseensure_mcu_halt
caused an abstractcs cmd error somehow.I added a temporary fix in my own fork of the repo which just clears the abstractcs cmderror queue on each call to
ensure_mcu_halt
. This seems to have fixed the issue, but I'm hesitant to open a PR, since I'm unsure whether this is actually a fix for the root cause of the issue and or just a workaround. I'd appreciate it if someone more familiar with WCH-Link could have a look at the fix first.Full log of
wlink -v regs
from when this issue occurs:Note that the
cannot read chip id
log is most likely unrelated to this issue as it happens with this board regardless of whether theAbstract command error
occurs.