Content originally posted in LPCWare by kiryat8 on Wed Dec 14 05:57:24 MST 2011
Since I am the sole real time programmer at a very small company, I do not have the resources or time to go over the whole USB 2.0 documentation which I see is (.zip file format, size 13.7 MB). This is the plain truth. I never have time to reinvent the wheel so I hoped someone else on the forum had already experienced the same situation I had.
I used the standard Code Red LPC170xx USB stack example to build on.
Since you say that the iSerialNumber field indexes a string descriptor field.
Three is used in their example, so it must be the last string.
I reverted to the original example code with iSerialNumber as 3 on my main LPC end unit.
I changed my secondary LPC end unit's last letter of the last string
"DEADCODE" to "DEADCODF".
Now I get my desired results.
Both units are assigned by Windows a different serial channel but this channel is the same even when moving the units to different USB ports.
Since we never need to have right now more than one unit of the same type connected to a single PC, this is just great.
If we would need multiple units of the same type, I will just put 0 in the iSerialNumber and then they will be USB port dependant.
Thanks
David
Original Code:
// string descriptors
0x04,
DESC_STRING,
LE_WORD(0x0409),
0x0E,
DESC_STRING,
'L', 0, 'P', 0, 'C', 0, 'U', 0, 'S', 0, 'B', 0,
0x14,
DESC_STRING,
'U', 0, 'S', 0, 'B', 0, 'S', 0, 'e', 0, 'r', 0, 'i', 0, 'a', 0, 'l', 0,
0x12,
DESC_STRING,
'D', 0, 'E', 0, 'A', 0, 'D', 0, 'C', 0, '0', 0, 'D', 0, 'E', 0,
// terminating zero
0
};