changing serial has no effect?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ulao
Rank 4
Rank 4
Posts: 480
Joined: Mon Aug 25, 2008 8:45 pm

changing serial has no effect?

Post by ulao » Fri Jul 10, 2015 4:17 am

I tried to change

#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e'
#define USB_CFG_SERIAL_NUMBER_LEN 4

to

#define USB_CFG_SERIAL_NUMBER '1', '0', '0', '1'
#define USB_CFG_SERIAL_NUMBER_LEN 4

The macros are being used in the code, but the serial is always 0. How can I change the serial?

I also tried setting it directly both in the definition and redefining it later.

const PROGMEM int usbDescriptorStringSerialNumber[] = {
USB_STRING_DESCRIPTOR_HEADER(4),
'1','0','0','1'
};

but it's still 0.

ulao
Rank 4
Rank 4
Posts: 480
Joined: Mon Aug 25, 2008 8:45 pm

Re: changing serial has no effect?

Post by ulao » Fri Jul 10, 2015 9:52 pm

huh I was able to make it work by changing
USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER != 0 ? 3 : 0, /* serial number string index */
to
USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER != 0 ? 3 : 1, /* serial number string index */

So I guess the define for USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER is the issue.
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER USB_PROP_LENGTH((6*2))

Not sure what is going on here?

Post Reply