Really need to dig into Segger RTT. Most of the chips I'm working on don't have SWO.
Post
@petrillic you do NOT want to know how WCH does it. It’s… not great. And WAY slower than even using a 9600 baud UART in polling mode.
@jpm what horrors await! 😊 I mean, I guess it's "acceptable" for printf() logging, but definitely useless for tracing.
Then again, I'd expect Segger to know what they're doing.
The wiki seems to imply the overhead/latency of RTT is multiple orders of magnitude better than SWO even.
@petrillic yeah Segger RTT performs pretty well on the ARM platforms I’ve used it on, especially when used with that quasi-host-side logging thingo that Rust does that I can’t remember what it’s called right now.
@jpm I do have some projects with WCH chips on the back burner right now. But fortunately they're "simple" enough that even that shooud be OK. Or I may just pull a UART out anyway. I have a footprint for TC2050 that can handle either USB or UART. Forgot who I stole that idea from.
@petrillic yeah the WCH hardware debugger is a piece of shit, and on any WCH part “bigger” than a CH32V003 they use their own undocumented debugging protocol which kinda sorta vaguely looks like SWD that only works with their own debugger.
And talk about coincidence, right now I’m laying out a TC-2050 pinout I’ve used in the past that connects SWD, UART, and power.
@jpm Sadly, Segger only supports (right now) the CH32H parts (which are Arm chips). Which is weird, because they do support a ton of RISC-V chips as well.
@petrillic yeah I’ve been watching it too. This would be because WCH has 3 different debug protocols - standard (documented) ARM SWD on their ARM parts, custom (documented) 1-wire on the RISC-V ‘003 family, and a custom (undocumented) 2-wire on all the other RISC-V parts that kinda sorta works a bit like SWD in that there’s a clock and a data line. There are a couple of efforts floating around to reverse the SWD-like custom debug protocol both on the SWD wire and talking to the debugger via USB. The debugger is so shit though, I’d love for Segger to support the WCH RISC-V parts but I don’t think it will happen soon.