Wednesday, September 10, 2008

The Communications device class (CDC) in the Microchip USB framework does not set iSerialNumber, so what ends up happening is that every time you plug in the device it gets a random COM port assigned to it. These code modifications allow you to set iSerialNumber from EEProm which will allow the device to come up as the same COM Port on both linux and windows. This also has the advantage that it allows the serial number to be set during testing via usb instead of compile time, which is handy if you are making a bunch of boards. usb_descriptors.c