[Cryptech Tech] USB interface

Peter Stuge peter at stuge.se
Thu May 28 04:12:09 UTC 2020


Rob Austein wrote:
> > On rev03, PCs can only try to use a heuristic with the RPC protocol to
> > guess if the board is running/available or not.
> > 
> > This proposed USB interface is self-powered, by VCCO_3V3, so when this
> > interface is connected to a PC the USB device comes and goes on the PC
> > as the 18V supply is connected and disconnected from the rev04 board.
> > 
> > Is that change desirable?
> 
> The only reason I can think of why the host side might care is if the
> OS drivers are going to renumber the USB device every time it appears.

The USB device will quite likely get a different "device address" but
that doesn't really matter outside of the USB stack.

What device node (if any) is created by the host depends on device firmware
and on host configuration. On Linux it would be easy to use a udev rule file
to create device nodes/symlinks which are reliably locked to an individual
board.


> What I would like very much, though, if it's not a lot of trouble,
> would be some way for the host side to identify these USB devices
> easily and tell them apart from each other.

It's no trouble at all. Indeed this is one significant benefit of having
a programmable USB interface.


> What we do right now is seriously disgusting: we look for USB devices
> matching "VID:PID=0403:6014", then throw a particular magic byte
> string at any such device; that byte string is guaranteed to parse as
> (relatively) harmless garbage both in the RPC protocol and on the
> management CLI, and we can guess which one we found by examining the
> resulting error response.  Feh.  Please let's do better.

We can improve that with several different methods.

For one, we can set VID and PID as we please. Since CrypTech is open source
we can get valid PIDs under the defunct OpenMoko VID at no cost. Or we can
spend $6000 to get our very own VID. In any case, we can always use the
reserved 0x6666 prototype VID for development. (But not ship with it!)

So we can set different VID/PID on each interface.

This reminds me - I wanted a port detect signal in the interface so that
firmware can know which port it services. Schematic revision 2 is attached.


But even if our firmware emulates FTDI and both ports use the same VID/PID
then we could still set different string descriptors, which are available
in udev rules, so we can always distinguish the two ports easily.


Thanks a lot!

//Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cryptech-rev04-usb-2.pdf
Type: application/pdf
Size: 7877 bytes
Desc: not available
URL: <https://lists.cryptech.is/archives/tech/attachments/20200528/f9f3320d/attachment-0001.pdf>


More information about the Tech mailing list