CH32V003, CH565, CH569 - complete erase including fuses? - Page 1
Forum section: electronics / general

author: Howardlong
author_rank: Super Contributor
timestamp: May 25, 2025, 05:38:38 am
content: I have a four CH32 dev boards that were shipped with firmware that I can't figure out how to completely erase them back to factory settings.As a workaround, I've replaced the chips on three of these boards with fresh devices, and can then both program and debug these new chips on these dev boards.I'm using a WCH-LINKE v1.03 programmer/debugger in LinkRV mode.I've tried the WCHISPStudio and the WCH-Link utilities, but they don't recognise the original chips or let me erase them.I am guessing that certain fuse options might be a one-way street on these devices, and if so that is useful to know as it means I can stop wasting time on this.Perhaps they had an IAP or similar bootloader on them, but I don't know what software I'm supposed to use with it, or how to create debuggable images to work with them.

author: bingo600
author_rank: Super Contributor
timestamp: May 25, 2025, 08:09:54 am
content: This was for a ch32v307 in DFU mode, and might be totally unrelated.But then again ...... Maybe worth a shothttps://www.eevblog.com/forum/microcontrollers/ch32v307-modbus-web-ui-firmware/msg5312677/#msg5312677wchisp programwchisp config reset** Must power reset device after config reset ... "Flash unprotect" (like on stm)

author: OZ1LQB
author_rank: Regular Contributor
timestamp: May 25, 2025, 11:32:14 am
content: Hi..i useWCH linkutility v2.40under target selectClear all code flash-by-power off

author: HwAoRrDk
author_rank: Super Contributor
timestamp: May 25, 2025, 07:52:04 pm
content: Quote from: Howardlong on May 25, 2025, 05:38:38 amWCHISPStudio is for use with the serial/USB bootloader, and WCH-Link is for use with a WCH-LinkE adapter and the debug interface - be aware of the difference, and also that they have slightly different capabilities.For either, how are you connecting to the chips? Make sure you're connected correctly.The CH32V003 uses a single-wire debug connection (SWIO) on pin PD1; that's the only connection you need and should be connected to the SWDIO pin on the WCH-LinkE adapter. The CH56x appears to uses regular two-wire SWD on PA10 (clock) and PA11 (data), to be connected to the SWCLK and SWDIO pins on the adapter, respectively.For bootloader access, how are you triggering the bootloader on the CH56x? It's not mentioned in the datasheet, but from a quick search it appears you have to hold PA5 to ground at power-on. It appears it supports either USB or UART. On the '003 you won't have any luck trying to interact with the (UART-only) bootloader unless the existing firmware has some means of resetting into it - there are no BOOT0/1 pins on that chip, so the only way into the bootloader is under software control.It may be that the bootloader and debug interfaces have been disabled. For the CH565/569 it appears possible to do so in the "fuse" option bytes (a.k.a InfoFlash). For the CH32V003, it doesn't have such settings, but the firmware can disable the SWD pin at runtime (which is not saved).Quote from: Howardlong on May 25, 2025, 05:38:38 amAs far as I am aware, none of the option bytes (i.e. fuses) are permanent OTP on WCH RISC-V chips. But as mentioned above, they do have options to disable bootloader and debug interfaces, and also enable read-out protection.Quote from: OZ1LQB on May 25, 2025, 11:32:14 amI believe that works only under the condition that the target is being powered solely via the WCH-LinkE (which is then able to control power). It works for the '003, but I don't know if that also works for the CH56x.