Early on in the Glasgow development Rod Whitby proposed a USB-C PD interface. The project is stalled am talking to Rod about reviving it but it occurs to me that glasgow is probably overkill for this application so I might build a plank instead. The details are at glasgow-addons/hardware/usb-pd-addon at usbp-pd-addon · rwhitby/glasgow-addons · GitHub
Am posting here in case this grabs someone else’s attention and they want to take the idea and run with it. My project completion rate is pretty low these days unfortunately.
Rod is sending me his protos, first step will be to interface them to the BP, will need to mux a lot of the IO since glasgow has 16pins and BP has 8. Will come back once I have the electrical planned.
@ian, imho, the ability to query and probe e-marked USB-C cables would be a keynote-worthy capability for the BusPirate!
Brainstorming… what if the plank had two USB-C connectors? Could it then identify / differentiate:
Single-ended e-marked USB-C cable
e-marked USB-C cables with different data per side(!)
e-marked USB-C cables that correctly report same data on both ends
Dumping of the e-marked data with possible interpretation … is that 100W cable you bought actually reporting itself as capable of 100W?
As stretch goals / later additions that might impact what pins you connect… Could other common problems be detected? (e.g., are there charge-only USB-C cables? do some have excessive voltage drop due to wires that are too thin? etc.)
Well, here’s a nifty schematic I found. Sadly, the person is no longer making these available on Tindie. I wonder how much something like this would cost (fully populated) from Ian’s crew? <poke, poke>
Here is something that looks similar from my bookmarks: https://github.com/smaroukis/usb-sleuth
The description says it does detect the e-markers, but I haven’t tried it yet.
I think this cable testing thing could be one useful feature of a plank for the bp, but other things, like testing PD sources, sinks, role-swap, sending arbitrary pd-messages to pd controllers and seeing what happens, should also be possible.
If you are looking for a dedicated cable tester, the project I linked is probably better because as a dedicated tool it is easier to use.
For BP5, likely could do much better than these devices. With that many pins, might want to mux the two connections, then test for any improper cross-connections… (E.g., mux to sending voltage only over one pin at a time, and then detect which pin(s) it shows up on the other connector; Also allow checking if shield and ground are connected, etc.)
Thus, no need for the LEDs… use the BP screen to display the results. The costly bit is the sheer number of USB connectors needed (plus one time engineering costs). When coupled with the ability to not only detect, but query the e-marker, … SO useful!
My plan is to port Rod’s original intent to BP. More of a general purpose tool to learn about USB-C PD than anything dedicated. His original design used 16 IO at both 5V and 3.3V porting it to 8 IO at 5V is my first challenge.
You think too highly of my skills. I get too frustrated with the tooling for schematics (EasyEDA, KiCad, Fusion360 aka Eagle).
A GPIO extender + two of those fancy USB-PD chips to query the e-marker … all of which can be accessed via I2C … then I can write the logic to test the full connectivity matrix + port the USB-PD features over to BP5. Someone else would need to design the board … it’s not my cup of tea.
Just now had a chance to check this a bit. So the mux is needed to have 24 pins for each side of the cable? 48 pins total? Is that like with an analog mux so a single set can do input and output? Or like a boat load of 595s and 166s? If hardware is what is needed, I can get it sorted if I know the approach.
Ok, just read the hack a day posts and the datasheet for FUSB302B.
This is really interesting. I didn’t read the protocol spec yet, I’m curious how negotiation for host/device works and how you manage talking to the cable e marker and also e.g. the power supply (multiple devices). Need to keep reading
This just makes me want to stick my finger in every register! With a warning like this you know there’s some good stuff in there.
While this isn’t precisely a cable tester, this open source project , the USBValve, is an inexpensive way to detect evil cables like the Evil Crow. Perhaps it could be modified to detect e-marked cables? A simple plank could be maded for the BusPirate, and an Evil cable detector plank that would detect the O.MG cables would be very cool and not too expensive to build. The USBValve is just a Pico, a display, and a female USB connector.
(finally added forum.buspirate.com to my hosts file so I don’t have to tether to my phone to post here - site is still blocked by cloudflare family dns despite my best efforts)
I’m going to look at porting Rod’s schematic to BP. A lot of work and discussion went into this design, I want to retain as much of it as I can. Original schematic is below
Changes
Run all the IO at 3.3V and boost to 5V for VBUS_OUT
Change the FUSB302B VDD to 3.3V so all its IO moves to 3.3V
Direct Pin
FUSB SCL
FUSB SDA
FUSB INT
SBU1_3V3
SBU2_3V3
USBP_3V3
USBP_3V3
CTRL
CTRL will be a uart to a cheap cpu (CH32V003?) to control low speed pins using a simple single character protocol like repeat the same command 3 times to be valid, lower case for off, upper case for on.
CTRL Command
Muxed Pin
Default
a/A
SBU1_DIR
Input
b/B
SBU2_DIR
Input
c/C
SLV
3.3V
d/D
USBP_DIR
Input
e/E
USBN_DIR
Input
f/F
ULV
3.3V
g/G
VEN
off
The only IO we lose is the FLT on the AP2171W power switch, can’t avoid this.
One desirable thing the original design didn’t have is the ability to isolate the FUSB302 from the bus and sniff CC1/CC2. Not sure how to add this, could be on a second set of usb-c connectors but there are no IO left.
This will be expensive to produce in its current form. Once we work out the functionality I think we can depop (and 0R bypass) a bunch of parts to make a lite version that is FUSB302B only, probably with the IO at 5V to remove the boost regulator.
The low speed pins are connected to the BP via the U2A and U4A analog switches. The glasgow was all digital but if the BP has ADC on these pins then their analog level could be read.
I personally have no intention of supporting QC 2.0/3.0 but this could be done as above. From my pov this is intended to be a USB-C plank, QC is not a USB-C protocol.
I had a board very much like that one pictured on AMazon. The problem for cable testing is that it doesn’t run a signal through each pin individually and confirm that the neighboring pins DON’T signal. So you could twist all the wires together and it would “pass”.
Doing that takes more than just passive parts and I don’t see anything particularly active on that board. Even a mid-grade CH32V003 that’d raise a GPIO and then confirm ONLY that pin was raised would be enough. Oh. I guess you might need one '006 for output pins and another for input pins and then some kind of signalling between them. I’d have to think if you could pull that off with 18 (?) diodes cheaper than another MCU or something. I’ll leave that to you hardware experts.
The Pinecils were laid out with different PD tranceivers. The PD302 was chosen.
QC2 and 3 shouldn’t have existed. PD (rightfully) won.
For a minute there in this post from wow four years ago I was thinking that there was some want for a plank that did something similar to the USB cereal on crowdsupply or the minnow on tindie.
I do a fair bit of usb research with all the greatscott gadgets, but USB-c, pd driver debugging, and other items are on my list to dig into.
Welcome. I cant speak for others, although I believe they’d say similar, I appreciate the info.
I’m curious, what kind of work do you do with usb and great scott gadgets?
Hi, Mostly reversing other people’s weaponized tooling. Usually from a forensic/dfir standpoint in cases. I also run into cases of backdoored firmware and things of that nature. I used the bus pirate og version for many many years to get at things while they were running on chips. Now getting more into the hardware side of things, so this is such a great forum to read and learn from. Thanks!.