4 ms·
USB has some pretty nifty ideas buried under a descriptor and software specification that was clearly designed by hardware guys colluding with some firmware typ
by kabdib 12y ago
USB has some pretty nifty ideas buried under a descriptor and software specification that was clearly designed by hardware guys colluding with some firmware types. Those things are not simple. It's a crappy way to describe a device to an OS.
The core USB descriptors are . . . okay, if you put yourself in the position of a firmware guy with like zero bytes left in code space. The howling gotchas start when you get into the higher level stuff, like multimedia. It takes an unholy amount of firmware and driver-side code to make a UVC device.
Why can't standards be simple?
Some of the standards are examples of craven bad design, too. For instance, there's a standard conversation that I have regarding DFU, Device Firmware Update:
Engineer: "What do you think about DFU?"
Me: "It's a pile of crap. It's 900 feet of rope on a 1,000 foot cliff, and you'll be fixing bugs in firmware update stuff for a long time."
Engineer: "I've been told to use it. It's a standard. How bad could it be?"
Me: "See you in month."
(a month goes by)
Engineer: "Holy shit, you were right. But I've been TOLD to use it, because it's a standard and would save a bunch of time. All we're doing now is fixing firmware update bugs, re-enumeration bugs in the host OS, and I've got a pile of bricked units that I have to go through every morning."
Me: (heavy sigh; this stuff just isn't that hard, okay?)
Variations on this conversation include "Oh, the chip vendor has a DFU implementation already, it's in ROM" [do not walk, RUN away from that chip...], and "Don't worry, we just tell the user to not unplug the device during the update" [bangs head against desk].
The USB 3.0 host controller spec was actually rather nice (even if all the chips I saw had different and sometimes quite spectacular bugs].
- userbinator 12y agoI wonder how many common USB devices out there use DFU - I remember reading something about how it would be a standard for Android smartphones/tablets, but that doesn't seem to be the case, with each manufacturer using its own proprietary protocol. Ironically enough, the update code in the ROM of my phone's SoC emulates a USB serial port (CDC)...
- makomk 12y agoA fair few devices use DFU - for example, the Atmel-provided USB bootloader for many of their chips is DFU, and a number of ST Microelectronics chips have a DFU bootloader in ROM - and they're all subtly incompatible with each other. So for example, right now I've got one DFU utility installed that only supports Atmel AVR chips and another one that supports STM32F2/3/4 devices and a few other pieces of hardware. Even then, there are many devices out there which aren't compatible with either and require special proprietary tools.
- mikepurvis 12y agoAh yes, I'm having fun times with the ST ROM bootloader and dFuSe/dfu-util. What a mess.