Call for testers: probe-rs flashing for the full (most?) CH32 family
#176
Replies: 11 comments 6 replies
|
CH32V003 works! Flash & defmt-rtt works nicely. I also tested SYSTEM by flashing tinyboot and Option Bytes. They all work. |
|
CH32V00X working: Flash & defmt-rtt tested to be working. probe-rs hardware breakpoints don't work. QingkeV2 has no hardware breakpoint support, use software breakpoints instead. They work fine. E.g.: #[macro_export]
macro_rules! breakpoint {
() => { unsafe { core::arch::asm!("ebreak") } };
}I was able to use VSCode + probe-rs Debugger extension + |
|
CH32V103 is working. No hardware break point support either, but flashing system / optional bytes / user flash all work. The system flash on this chip is split into two banks, and flashing optional bytes didn't work because probe-rs detected two flashing algorithms (system flash and ob flash) that covered the same region. This has been fixed on main. |
|
CH32V203 is now working. system / optional bytes / user flash all work. Again, Qingke V3B doesn't have hardware breakpoints. software breakpoints only. (use the macros mentioned earlier ) note: system flash didn't work initially. this is because V3 flash require undocumented bits flipped in order to allow programming the system flash. See ch32-rs/ch32-data@62145f5 for more details. |
|
CH32V307 works. System/Option Bytes/User flash all work. Also break points works with VSCode, it supports max of 4 break points. We see RAM is 64KB, total flash size is 480K, with 256KB as 0wait, and the rest is non-0wait. Now, changing Option Byte
Now we see RAM is 128KB, total flash size is still 480K, but 192K is 0wait, and the rest is non-0wait. |
|
CH32X035 works! ❯ probe-rs chip info `probe-rs info`
CH32X035F8U6
Cores (1):
- main (Riscv)
NVM: 0x08000000..0x0800f800 (62.0 KiB)
NVM: 0x00000000..0x0000f800 (62.0 KiB)
NVM: 0x1fff0000..0x1fff0d00 (3.2 KiB)
NVM: 0x1ffff700..0x1ffff800 (256 B)
NVM: 0x1ffff800..0x1ffff900 (256 B)
RAM: 0x20000000..0x20005000 (20.0 KiB)Flash & defmt-rtt works nicely. |
|
CH32L103. > probe-rs info
CH32L103C8T6
> probe-rs chip info CH32L103C8T6
CH32L103C8T6
Cores (1):
- main (Riscv)
NVM: 0x08000000..0x08010000 (64.0 KiB)
NVM: 0x00000000..0x00010000 (64.0 KiB)
NVM: 0x1fff0000..0x1fff0d00 (3.2 KiB)
NVM: 0x1ffff700..0x1ffff800 (256 B)
NVM: 0x1ffff800..0x1ffff900 (256 B)
RAM: 0x20000000..0x20005000 (20.0 KiB) |
|
CH32X035F7P6, early batch with I2C bug. > probe-rs info
CH32X035F7P6
> probe-rs chip info CH32X035F7P6
CH32X035F7P6
Cores (1):
- main (Riscv)
NVM: 0x08000000..0x0800c000 (48.0 KiB)
NVM: 0x00000000..0x0000c000 (48.0 KiB)
NVM: 0x1fff0000..0x1fff0d00 (3.2 KiB)
NVM: 0x1ffff700..0x1ffff800 (256 B)
NVM: 0x1ffff800..0x1ffff900 (256 B)
RAM: 0x20000000..0x20005000 (20.0 KiB) |
|
Just a quick update for you:
In the mean time, do you mind testing CH32H4 chip(s)? I don't have them handy. You'll need to reinstall with this new command since integration branch is now Thank you! Let me know if there is anything else you want me to do. |
|
Just tested on my end, for some reason flashing is a lot slower using probe-rs compared to wlink. With wlink, flashing 13kb to a CH32V203 happens in about a second while commit |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
UPDATE
The whole set has been upstreamed to official probe-rs, but a new version is not yet released. You can now install from the official git repository:
I've been migrating our flash-algorithms onto
ch32-metapacin preparation to upstream toprobe-rs. It's ready for daily-driver testing — please use it on your normal projects and leave a comment with how it went.Supported chip families
algos/v0flash_v0algos/v00xflash_v00xalgos/v1flash_v1algos/f1flash_v1algos/v3flash_v3algos/x0flash_x0algos/l1flash_l1algos/h4flash_h4126 target variants total. Auto-detected — no
--chipflag needed.✅ = USER / SYSTEM / OPTION-BYTES flash verified on at least one chip in the family (algo is shared across the family).
🙏 = help wanted — no hardware report yet.
Install
How to test
Set the cargo runner to
probe-rs runin your project's.cargo/config.toml:(or your chip's target triple, e.g.
[target.thumbv7m-none-eabi]for CH32F103). No--chipflag needed — auto-detection picks the right one.Then
cargo runyour normal project. Confirm it flashes and your output shows up. That's it.Tips
Confirm auto-detection with
probe-rs info— it should print your chip's exact part number. On V2/V3 chips with a non-defaultOB.USERRAM/CODE split, the detected name includes the ram-code option suffix (e.g.CH32V305FBP6_c192_r128).Verify the memory map with
probe-rs chip info <chip>(chip name from the previous step):Note, if you change RAM/CODE split in OB, the memory map should change as well
One caveat: use
defmt-rtt, notch32-hal'ssdi-print.sdi-printrequireswlinkon the host to drain bytes; under probe-rs it busy-waits forever and your program will appear to hang.In your comment: chip part number, did it flash, did you see output, anything weird.
All reactions