We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi
I have a unique serial number saved in EEPROM for each PCB, I want to assign that serial number string to the USB descriptor, so on windows, I can see that serial number. How can I do this? I see the USB descriptor serial number is defined as macro, can't be changed in run-time.
Thanks Wang
An interesting thing here is this part:
__weak \ <==== weak linkage, so another file can contain a symbol of same name to replace this. const struct { struct { U8 len; U8 type; U16 langid; } desc_langid;
So in case this file contains lots of other things that a user do not want to change, then another source file should be able to redeclare USBD_StringDescriptor.
Aha, I know how how "__week" works. But in this case, USBD_StringDescriptor definition uses bunch of #define macros and conditional compilation, which are defined in usb_lib.c and usb_config.c. To extract USBD_StringDescriptor definition, we have to make these macros referable. It's so troublesome. In this reason, above method is easier and safer, just to delete "const" modifier.
Tsuneo