Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with unbricking CH32V003J4M6 using WCH-LinkE #484

Open
xinaovo opened this issue Jan 1, 2025 · 7 comments
Open

Problem with unbricking CH32V003J4M6 using WCH-LinkE #484

xinaovo opened this issue Jan 1, 2025 · 7 comments

Comments

@xinaovo
Copy link

xinaovo commented Jan 1, 2025

Hi there! I compiled and uploaded the template code(which uses the debug pin PD1) to the MCU and I found that I couldn't upload other code to the MCU any more. So I tried to unbrick it using command minichlink -u but it stuck at Connection starting for a while and failed. The log is shown below.

minichlink -u
Found WCH Link
Entering Unbrick Mode
Connection starting
Programmer wasn't initialized? Fixing

DMStatus After Halt: /0/ffffffff
Fault on op (DMABSTRACTS = ffffffff) (-1) (Other Error) DMSTATUS: ffffffff
Unknown chip type.  Report as bug with picture of chip.
Vendored: ffffffff
marchid : ffffffff
HARTINFO: ffffffff
Chip Type: 0
Fault on op (DMABSTRACTS = ffffffff) (-1) (Other Error) DMSTATUS: ffffffff
Unknown chip type.  Report as bug with picture of chip.
Vendored: ffffffff
marchid : ffffffff
HARTINFO: ffffffff
Error: Flash is not unlocked (CTLR = ffffffff)
Error: Flash is not unlocked (CTLR = ffffffff)
Error: Flash is not unlocked (CTLR = ffffffff)

However, after reinstalling the WCH vendor driver and using "Clear All Code Flash-By Power Off" in the WCH-Link Utility, the MCU was unbricked successfully.

image
image

btw, the connection between MCU and WCH-LinkE programmer as well as the version of WCH-LinkE and WCH-Link Utility is shown below:

WCH-LinkE > CH32V003J4M6
SWDIO > Pin 8
GND > Pin 2
3V3 > Pin 4

WCH-LinkE version(reported by minichlink): 2.15
WCH-Link Utility version: 2.30
@roboticboyer
Copy link

See here the procedure/trick with minichlink -u (required a power off)

@jptrzy
Copy link

jptrzy commented Feb 8, 2025

See here the procedure/trick with minichlink -u (required a power off)

I also have the same issue, even thou I used the suggested method.

@xinaovo
Copy link
Author

xinaovo commented Feb 9, 2025

See here the procedure/trick with minichlink -u (required a power off)

Hi there! Thank you for your reply. I tried the trick in the video but it didn't work. In theory, the programmer can control its power output and power off the MCU by itself and that's how the official tool works. However, rvprog, a python-based CH32Vxxx utility, works just fine. So I think it should be the problem of minichlink.

@cnlohr
Copy link
Owner

cnlohr commented Feb 10, 2025

What issue did you have with minichlink? (What what physical programmer are you using) I've tried to make it as robust as possible for unbricking.

@xinaovo
Copy link
Author

xinaovo commented Feb 12, 2025

What issue did you have with minichlink? (What what physical programmer are you using) I've tried to make it as robust as possible for unbricking.

I used wchlink-e with firmware version v2.15 as my programmer and tried to unbrick a SOP-8 CH32V003J4M6. I tried minichlink -u to unbrick the MCU. It didn't power off the chip and power it up again to enter the "unbrick mode". However, other tools like rvprog or the official tool works just fine.

Hi there! I compiled and uploaded the template code(which uses the debug pin PD1) to the MCU and I found that I couldn't upload other code to the MCU any more. So I tried to unbrick it using command minichlink -u but it stuck at Connection starting for a while and failed. The log is shown below.

minichlink -u
Found WCH Link
Entering Unbrick Mode
Connection starting
Programmer wasn't initialized? Fixing

DMStatus After Halt: /0/ffffffff
Fault on op (DMABSTRACTS = ffffffff) (-1) (Other Error) DMSTATUS: ffffffff
Unknown chip type.  Report as bug with picture of chip.
Vendored: ffffffff
marchid : ffffffff
HARTINFO: ffffffff
Chip Type: 0
Fault on op (DMABSTRACTS = ffffffff) (-1) (Other Error) DMSTATUS: ffffffff
Unknown chip type.  Report as bug with picture of chip.
Vendored: ffffffff
marchid : ffffffff
HARTINFO: ffffffff
Error: Flash is not unlocked (CTLR = ffffffff)
Error: Flash is not unlocked (CTLR = ffffffff)
Error: Flash is not unlocked (CTLR = ffffffff)

However, after reinstalling the WCH vendor driver and using "Clear All Code Flash-By Power Off" in the WCH-Link Utility, the MCU was unbricked successfully.

image image

btw, the connection between MCU and WCH-LinkE programmer as well as the version of WCH-LinkE and WCH-Link Utility is shown below:

WCH-LinkE > CH32V003J4M6
SWDIO > Pin 8
GND > Pin 2
3V3 > Pin 4

WCH-LinkE version(reported by minichlink): 2.15
WCH-Link Utility version: 2.30

@cnlohr
Copy link
Owner

cnlohr commented Feb 14, 2025

This is a little surprising. Is this in Windows? Or Linux? And, also, are you recompiling the .exe. It's been quite some time since a new .exe has been checked into the main repo.

@cnlohr
Copy link
Owner

cnlohr commented Feb 14, 2025

Also, you may want to iteratively work on this with some folks live? If you're interested ping me on discord, and I can give you an invite. My name on Discord is cnlohr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants