Serial number string sent as string 0!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        I am playing around with the PSoC Development Kit. I created a simple USB test app based on the AN56718 app note (USB BULK Loopback with PSoC). I'm seeing that the PSoC device sends back the serial number string when the host requests the LangId string (i.e. string 0). The USB Spec states that only the LangId string can used for string index 0. This is clearly a bug in PSoC Creator since string 0 appears both in the Device Descriptor and String 0 descriptor.   
   
(See attached files)   
   
My USBFS Configuration is the same as in AN56718 except for the fact that i am using an Isochronous IN EP of size 1023.   
0 Likes
1 Reply
Anonymous
Not applicable
        I concur that this is a Creator bug.   
   
I have a workaround.   
   
Using the USBFS component configurator create 3 generic string descriptors, along with the special serial number string. Generate the source code.   
   
in ..\GENERATED_SOURCE\PSoc3\USBFS_1_descr.c,   
find the DEVICE descriptor, which starts something like:   
   
/*********************************************************************   
Device Descriptors   
*********************************************************************/   
uint8 USBFS_1_CODE USBFS_1_DEVICE0_DESCR[] = {   
/* Descriptor Length */ 0x12u,   
/* DescriptorType: DEVICE */ 0x01u,   
/* bcdUSB (ver 2.0) */ 0x00u, 0x02u,   
.   
.   
.   
   
then change the string descriptor index for iSerialNumber to a unique non-zero number:   
   
/* iManufacturer */ 0x01u,   
/* iProduct */ 0x02u,   
/* iSerialNumber */ 0x03u,   
   
Recompile. (Redo the edit after each regeneration of the source code)   
   
The runtime code checks the requested string index against the value stored in the code space device descriptor at the offset of iSerialNumber (at USBFS_1_DEVICE0_DESCR[USBFS_1_DEVICE_DESCR_SN_SHIFT]). If it matches, the special serial number string processing is used.   
0 Likes