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

Doesn't support CH32 with probe-rs #28

Open
jonathanherbstgrapple opened this issue Oct 31, 2024 · 8 comments
Open

Doesn't support CH32 with probe-rs #28

jonathanherbstgrapple opened this issue Oct 31, 2024 · 8 comments

Comments

@jonathanherbstgrapple
Copy link
Contributor

I've been playing around with a WCH32 board. It has an onboard debugger which works with probe-rs, but when I try to run with the rusty probe I get this.

probe-rs run --chip CH32V307 target/riscv32imafc-unknown-none-elf/debug/blinky
Error: Connecting to the chip was unsuccessful.

Caused by:
    0: An error with the usage of the probe occurred
    1: The selected probe does not support the 'RISC-V' interface.
@korken89
Copy link
Collaborator

korken89 commented Nov 6, 2024

It has not implemented that interface, only SWD / JTAG is supported by hardware.
If you know how to implement the debug protocol used by the WCH32 series I'd welcome a PR to implement support!

@jonathanherbstgrapple
Copy link
Contributor Author

It looks like their protocol is SWD, that's why I made a ticket here. Now, I'm not sure if it's a different brand of SWD than ARM SWD, but I wonder if probe-rs doesn't try because of some configuration that's communicated to it.

@korken89
Copy link
Collaborator

korken89 commented Nov 6, 2024

Ah alright! I can't find if it's ADI v5 they implement, probably needs more looking.

@jonathanherbstgrapple jonathanherbstgrapple changed the title Doesn't support RISC-V with probe-rs Doesn't support CH32 with probe-rs Nov 6, 2024
@Yatekii
Copy link
Member

Yatekii commented Dec 11, 2024

The selected probe does not support the 'RISC-V' interface. is JTAG not SWD :)

@Tiwalun
Copy link
Member

Tiwalun commented Dec 11, 2024

As far as I remember, it is not SWD but their custom protocol, which is almost SWD.

It's this one, I think: https://perigoso.github.io/rins/rvswd/index.html

@Yatekii
Copy link
Member

Yatekii commented Dec 11, 2024

Oh, I was sure RISC-V was always JTAG. I am sorry.

@jonathanherbstgrapple
Copy link
Contributor Author

So this is something that WCH came up with and not a RISC-V standard?

@korken89
Copy link
Collaborator

@jonathanherbstgrapple Looks like it, but the format looks very similar to SWD, extending with this support should be quite straight forward - at least for the bit-banged driver.
From a glance it seems like the SWD PIO driver would need modifications, but that needs a closer look.

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