Hack Chat Transcript, Part 2

A event log for Hacking USB Hack Chat

Flip three times for best results

LutetiumLutetium 02/26/2020 at 21:060 Comments

Kate Temkin12:32 PM
@alexwhittemore That means you need to start scheduling the transfers in advance; which means using the async API; which brings the Usual Asynchronous Fun.

Twisted Pair in my Hair12:32 PM
In KiCad (newer versions at least) diff-pairs are pretty easy to route. Pcbnew automatically detects lines ending with "+"/"-" or "_P"/"_M" and starts a diff-pair. So I didn't even waste a lot of time on it.

RichardCollins12:34 PM
Every device should support "local processors" that can speak full speed to the sensors. Collect raw data, then analyze that data for optimal LOSSLESS compression. Many devices are running at high speed sending redundant data. Then wondering "why don't I have enough bandwidth to get my data from the sensor to the disk over there?"

ThanhTran12:34 PM
@Kate, would you have recommendation for any open source USB stack that don't use Linux?

Kate Temkin12:34 PM
@ThanhTran as in, an open source host-driver stack?

de∫hipu12:36 PM
tinyUSB is nice

ThanhTran12:36 PM
@Kate Temkin: Both host and device mode

ThanhTran12:37 PM
Thanks @de∫hipu

Paul Stoffregen12:37 PM
how well does TinyUSB really do host mode?

Kate Temkin12:37 PM
(Also: in regards to what I've been saying to @alexwhittemore: don't get me wrong -- you can use libusb quite effectively on Windows; you'll just need to do more "install time" configuration than on e.g. Linux or Mac.)

Paul Stoffregen12:38 PM
I see Adafruit & others using it, but mostly for device mode. Who's actually deploying TinyUSB for host use?

Kate Temkin12:38 PM
@ThanhTran I've used tinyUSB in device mode, and it is quite nice, if your CPU is supported by it [or you're willing to write a driver]. It has host mode; but I haven't played with that side of it. :)

ThanhTran12:40 PM
Thanks @Kate Temkin

de∫hipu12:40 PM
@Paul Stoffregen never used host mode on it, so I can't say, I think it does hid host on samd21 at least...

Kate Temkin12:41 PM
Host drivers are significantly more complex than device drivers; and embedded hosts applications on tiny microcontrollers are, relatively speaking, a lot more rare; so stacks like tinyUSB are usually built to target either a few easy cases or some very specific ones.

Kate Temkin12:41 PM
(Host *stacks, anyways)

RichardCollins12:42 PM
I have to leave now. You are all arguing how to optimize with parts within USB and the real issue, and probably the solution, is to deal with all devices. When you look at the core hardware interface in all OSs it has been treated as a stepchild of the OS that only wants to sell software or hardware. If the SENSOR community will set up their own core services in each OS, but independent, then you might gain some measure of control and stability. Then you can optimize USB to Ethernet, USB to disk, and the other data flows.

Data flow optimizations is NOT something that OS and browser are good at. So build it from the hardware up, but do it with a global open community. Raise the money. A few hundred million would be cheap.

WRR12:43 PM
I just saw nMigen mentioned above - it looks like a super cool project, but I haven't seen much information about it. Any thoughts on it?

Kate Temkin12:45 PM
@WRR Honestly, I think nMigen [or something that looks a lot like it] is probably the direction a lot of people will end up going in.

Kate Temkin12:45 PM
Original Migen has a pretty expansive community; even if it's not anywhere near as expansive as the "classic" languages (VHDL/Verilog).

Matti Virkkunen12:46 PM
I haven't touched FPGAs but at first sight having a real programming language to generate stuff with seems like a good idea

WRR12:47 PM
Yeah, it does seem like a friendlier sort of HDL, and the "misoc" moduar RISC-V core looked like a cool idea. Thanks, and sorry to distract from USB!

Kate Temkin12:47 PM
In what I've done with them, languages like nMigen and original Migen are incredibly empowering. It's extremely difficult to create an "open stack" that's more than trivially customizable in VHDL or Verilog, since the languages really limit how parametrically you can design things.

Twisted Pair in my Hair12:49 PM
@Kate Temkin What EMI protection would you recommend? What other companion ICs would you add on the board for a perfect USB design? Say you have USB connector and an FPGA; what's between them? I guess the answer is a bit different for USB host, USB device, USB OTG, USB Type-C with PD, USB Type-C with SS lines.

alexwhittemore12:49 PM
@Matti Virkkunen FWIW, designing FPGA hardware is almost nothing like programming in the classical sense, which is why HDLs look very little like "real" programming languages. But then the biggest issue with traditional HDLs like Verilog and VHDL is speed and ease of use, which is why projects like this have sprung up.

Kate Temkin12:50 PM
@alexwhittemore I'd actually argue that traditional HDLs are a bit too much like programming, but in all the wrong ways -- which is why we wind up kind of creating the right shape for our designs in VHDL or Verilog, and hoping a synthesis tool can infer what we mean from it.

Matti Virkkunen12:51 PM
@alexwhittemore Yes, I know the logic you're writing isn't like normal programming. But having a "real" programming language to aid in automation, generation and parametrization seems like a good idea.

Paul Stoffregen12:52 PM
@Kate Temkin - Has any testing been on how well ViewSB can process a continuous 480 Mbit/sec stream (or even some fraction, like sustained 20-30 Mbyte/sec transfer of SSDs), especially on Windows & Macintosh?

alexwhittemore12:52 PM
@Kate Temkin maybe. They definitely let you under-specify, in a way that looks like it should work but doesn't actually synthesize rationally.

Kate Temkin12:54 PM
@Twisted Pair in my Hair EMI isn't my area of specialty; but generally following the guidelines for {your individual USB frontend, the USB specification} regarding layout and impedance control goes a long way. If you're using something that's not meant as a PHY, a lot of avoiding EMI is the same complex impedance-matching problem that you have in other RF-frequency design.

salec12:56 PM
@Kate Temkin : how does a hacker / very small volume producer of gadgets deal with need for unique VID? The price is a little steep if you are not committed to idea of becoming a registered vendor.

Kate Temkin12:56 PM
VHDL and Verilog are languages designed to describe hardware -- you use them to describe behavior, and try to make it so your description maps well to the technology you're going to synthesize things into. nMigen is a python toolkit for _constructing_ hardware, rather than describing its behavior -- which is a subtle but important difference.

Kate Temkin12:58 PM
@salec Typically, the tactic is to use someone else's Vendor ID, with their permission. OpenMoko and e.g. give out PIDs to open source projects under their vendor IDs; which they've inherited from organizations that have e.g. stopped producing new devices.

de∫hipu1:00 PM
Adafruit also gives out PIDs for CircuitPython-based projects.

We're up to the one hour mark, so we have to let Kate get back to work if she needs to. Everyone is of course welcome to stay on and chat, though. I want to thank Kate for the lively and wide-ranging discussion, and thank everyone for participating.

Kate Temkin1:01 PM
It's been awesome chatting with you all. ^^

de∫hipu1:01 PM
@Kate Temkin thank you!

Paul Stoffregen1:01 PM
thanks :)

A reminder that I'll post a transcript right after the chat, and for next week's Hack Chat concerning On-Demand Manufacturing:


On-Demand Manufacturing Hack Chat

Dan Emery will host the Hack Chat on Wednesday, March 4, 2020 at noon Pacific Time. Time zones got you down? Here's a handy time converter! One of the downsides of this model is the need for initial capital to buy the machines and build the factory.

Read this on Hackaday

alexwhittemore1:01 PM

WRR1:01 PM
thank you!

Thanks @Kate Temkin! And thanks to everyone for dropping by. Hope to see you again soon!