OK, Dave’s suggestion has merit, but its only a partial solution, and I’d still recommend Polulu offer some guidelines here for folks like us doing things this, who need to test market a product with the wixel “as is”.
In this lines of code Dave mentioned, in the file called usb_cdc_acm.c within the SDK, this example replaces the serialNumberStringDescriptor string with a hard coded hex serial number “01020304”, without disturbing the original “serialNumberStringDescriptor” aggregate.
DEFINE_STRING_DESCRIPTOR(languages, 1, USB_LANGUAGE_EN_US)
DEFINE_STRING_DESCRIPTOR(manufacturer, 18, ‘P’,‘o’,‘l’,‘o’,‘l’,‘u’,’ ',‘C’,‘o’,‘r’,‘p’,‘o’,‘r’,‘a’,‘t’,‘i’,‘o’,‘n’)
DEFINE_STRING_DESCRIPTOR(product, 5, ‘W’,‘i’,‘x’,‘e’,‘l’)
DEFINE_STRING_DESCRIPTOR(mySerial, 8, ‘0’,‘1’,‘0’,‘2’,‘0’,‘3’,‘0’,‘4’)
//uint16 CODE * CODE usbStringDescriptors[] = { languages, manufacturer, product, serialNumberStringDescriptor };
uint16 CODE * CODE usbStringDescriptors[] = { languages, manufacturer, product, mySerial };
Upon recompiling my project and uploading it to a wixel, it once again triggers the typical “new hardware found” which again assigns a new com port, for the new wixel whose s/n appears to be “01020304”. Now…, anytime I load this same code into another wixel and plug it into the test PC, it immediately comes up as that same serial number, and hence same serial port. So presumably, it should be possible to re-point that “mySerial” to some other source within the project.
But this only partially solves the problem and as Dave mentioned creates others. For one thing, you still have to plug in your new wixels somewhere to download your project code, built with the modified SDK. So we’re still back to needing to delete all USB serial port references on one machine or another, to avoid serial ports endlessly piling up. Second, there no way to plug in two identical wixels simultaneously.
Another little gotcha is that at least for me, I’d like to have some way of knowing what the actual serial number, even if its no longer reported to the USB, to have some control over the product. Wouldn’t you want to know if someone is making unauthorized clones? Even if I had to resort to hard coding it would be nice to have some way to read the serial number and compare it to some coded reference. I’m probably am not understanding the “serialNumberStringDescriptor” aggregate because even before this experiment I tried displaying what it pointed to in a USB debug message (through the simulated com port) and it always was “00000000”.
uint8 XDATA report[10];
uint8 reportLength =0;
reportLength = sprintf(report, “%-8.8s”, serialNumberStringDescriptor);
if (usbComTxAvailable() >= reportLength)
usbComTxSend(report, reportLength);
// result is always “00000000”