News for hackers. Stuff that matters.
Re:Making USB devices – end to end guide to your first gadget by anymouse123456 on Monday June 03, 2024 @07:52AM (#40561762)
Friendly reminder that USB is not free.

You must pay a one-time fee of $6,000 in exchange Vendor ID [0].

[0] https://www.usb.org/getting-vendor-id

Re:Making USB devices – end to end guide to your first gadget by rm445 on Monday June 03, 2024 @08:18AM (#40561946)
Yeah, I was going to ask about this. I think ST Micro will sublicense you a PID under their VID, but with restrictions, and companies attempting to buy a VID and sell PIDs as a service have been sued?
Re:Making USB devices – end to end guide to your first gadget by michaelt on Monday June 03, 2024 @08:15AM (#40561930)
Many chip vendors will give you a PID under their VID if you're making a product. For example this blog post uses and ST chip, and they'll provide a PID if you request it [1] - free of charge, but subject to some conditions.

(Of course if your USB device needs Windows drivers, you'll still have to deal with things like code signing...)

[1] https://community.st.com/t5/stm32-mcus-embedded-software/dea...

Re:Making USB devices – end to end guide to your first gadget by brezelgoring on Monday June 03, 2024 @08:17AM (#40561943)
Wow, first time I hear about it, this is an eye opening experience.

I will think twice now before saying “why couldn’t they just use USB for this?”

Re:Making USB devices – end to end guide to your first gadget by yjftsjthsd-h on Monday June 03, 2024 @11:26AM (#40563621)
> I will think twice now before saying “why couldn’t they just use USB for this?”

I dunno, I think either you're doing a small run and you can just bake in a Teensy or whatever, or you're doing a big run and $6k is a drop in the bucket.

Re:Making USB devices – end to end guide to your first gadget by anymouse123456 on Tuesday June 04, 2024 @07:48AM (#40573429)
This is just plain wrong. Not every business is a megacorp or VC-backed unicorn.

Many, many products start life on a shoestring and small batch production runs.

There are other products that intentionally serve small markets, like people with disabilities.

For these organizations, $6,000 is not a trivial amount of money.

Re:Making USB devices – end to end guide to your first gadget by kraskoss on Monday June 03, 2024 @10:32AM (#40563005)
Even crazier, it's just a 16 bit value.

What are they gonna do when they run out?

Re:Making USB devices – end to end guide to your first gadget by zoobab on Monday June 03, 2024 @08:04AM (#40561848)
See also https://pid.codes/

For the DirtyJTAG project we use one of those:

https://pid.codes/1209/C0CA/

Re:Making USB devices – end to end guide to your first gadget by pjc50 on Monday June 03, 2024 @08:07AM (#40561864)
.. or use someone else's. I believe there's a hobbyist VID under which you can reserve PIDs, or in many cases you can just copy an existing product if your device is generic enough and you're not planning to sell a big production run.
Re:Making USB devices – end to end guide to your first gadget by hananova on Monday June 03, 2024 @12:45PM (#40564495)
There's pid.codes which uses a vid of a defunct organization, but before that there was also the F055 vid. I still use that vid because no company will accept that vid, since it's commonly used by foss projects.
Re:Making USB devices – end to end guide to your first gadget by Karliss on Monday June 03, 2024 @10:36AM (#40563040)
The part that makes me feel most uncomfortable about usb VID/PIDs is that they are only 16bits each. While I don't think 4billion unique commercial USB devices is limit we will reach anytime soon, efficiently managing the available address space is a different question. And unlike IPv4 addresses a range of USB VID/PIDs can't be as easily reused without making the VID/PID meaningless.
Re:Making USB devices – end to end guide to your first gadget by crote on Monday June 03, 2024 @11:04AM (#40563332)
By that time they'll just add an extra field to the protocol and assign a special "see other field" VID/PID pair.

For a lot of products the VID/PID combo isn't that important on a protocol level, and there's technically no reason why two completely unrelated products couldn't be using the same pair. In practice you're mainly going to use them for software to target a specific device, for example the Linux HID driver uses it to work around hardware/firmware bugs. But HID devices are self-describing, and that's the main mechanism used by the driver to figure out what has been attached and how to behave.

If modern OSes can do the same to distinguish hardware with the extra field, sharing the same value for backwards compatibility with legacy machines really isn't going to be a big deal. It's not like MAC or IPv4 addresses where a clash will essentially kill all communication.

Re:Making USB devices – end to end guide to your first gadget by anymouse123456 on Tuesday June 04, 2024 @08:02AM (#40573552)
The problem isn't the combined limit, it's the hard limit on Vendor IDs at 65,535.

Since very few companies have 65,535 products, almost all Product IDs in any given Vendor ID namespace are unused.

That is the maximum number of organizations on Earth that can be issued a USB Vendor ID until the spec is modified. They'll likely introduce a special Vendor ID that indicates to clients they should look elsewhere for the real (and longer) one.

While the rules were more lax many years ago, and some vendors are grandfathered in and can therefore share their Product ID allocation, these behaviors are explicitly prohibited by the USB-IF for newly issued Vendor IDs.

Re:Making USB devices – end to end guide to your first gadget by crote on Monday June 03, 2024 @10:54AM (#40563212)
For hobbyist use you can just pick a random value and it'll usually work. Open-source hardware can get a product ID for free from https://pid.codes. Small-run commercial hardware can usually get a free product ID from the maker of their USB-capable chip. And once you're big enough that you're designing your own chip, $6,000 isn't such a big deal anymore.

So yes, you are technically right, but it really doesn't matter all that much in practice. USB is by far one of the most accessible major hardware standards out there.

Re:Making USB devices – end to end guide to your first gadget by andoma on Monday June 03, 2024 @10:58AM (#40563251)
FWIW, for my own personal projects I resort to vendor id 6666 (Prototype).
Re:Making USB devices – end to end guide to your first gadget by teddyh on Monday June 03, 2024 @11:31AM (#40563683)
I’ve commonly seen OpenMoko’s ID, 1d50, used for free projects. See the list at <http://www.linux-usb.org/usb.ids>.
Re:Making USB devices – end to end guide to your first gadget by hananova on Monday June 03, 2024 @12:38PM (#40564426)
I just use 0xF055 as VID. What is the USB-IF gonna do?
Re:Making USB devices – end to end guide to your first gadget by nudgeee on Monday June 03, 2024 @01:45PM (#40565205)
NXP runs a USB VID/PID Program [0] for small production designs (<10,000 units) that use their MCUs. They’ll give you 3 PIDs for free under one of their VIDs. I use this in my side projects (~200 units) and works pretty well!

[0] https://community.nxp.com/t5/Kinetis-Microcontrollers/NXP-US...

Re:Making USB devices – end to end guide to your first gadget by CamperBob2 on Monday June 03, 2024 @03:29PM (#40566564)
Easy way around that is to license your PID(s) from MCS Electronics. They bought a VID before the USB-IF got around to prohibiting resale of PIDs.
Re:Making USB devices – end to end guide to your first gadget by anymouse123456 on Tuesday June 04, 2024 @07:44AM (#40573391)
Yes, for a single-use hobby product it doesn't matter much and you can just risk the collision. And yes, some vendors will generously let you have a Product ID under their Vendor ID, but then your product looks as if it was made by them when your customers plug it in.

If you plan to deploy more than a few devices you'll need a Vendor ID and people should know that there is a relatively large tax in front of that need.

Hard disagree on $6,000 not mattering. We build a small number of devices for severely disabled people and sell a few hundred a year. The USB IF was unwilling to budge at all on their prices and this was a large cost that we did not anticipate, and by the way, is technically shameful.

How much does a fucking number cost?

Well, it depends on how scarce you decide to make it, and of course, what the market will bear.