ch32-rs / wlink

An open source WCH-Link library/command line tool written in Rust.
Apache License 2.0
165 stars 31 forks source link

'wlink regs' resumes the CPU #65

Open OpusElectronics opened 4 months ago

OpusElectronics commented 4 months ago

Context:

[INFO] Connected to WCH-Link v2.9(v29) (WCH-LinkE-CH32V305)
[INFO] Attached chip: CH32V30X [CH32V307VCT6] (ChipID: 0x30700528)

If the CPU is halted with: wlink halt

then dumping registers with: wlink regs

does resume the CPU. Not sure if this an intended behavior, but it bit me.

andelf commented 4 months ago

A preferred way to fix this is to provide an in-app shell, holding the USB(probe) connection, making halt, regs a command. When cmd exits it detaches. No idea if --no-detach can fix this.