2021-01-21 07:15 AM
For some reasons it will be good to write my own MCU serial number for USB purpose.. Is it possible to change seria number of hte MCU and how to do this...
Solved! Go to Solution.
2021-01-22 03:00 AM
Any number that is persistently stored on the device will do. Could be stored in flash, user option bytes, external eeprom etc.. Just implement the Get_SerialNum(void) function and supply your own variant of deviceserial0 and deviceserial1.
2021-01-21 07:20 AM
No, but you can write your own code to generate the USB Serial number
2021-01-22 02:39 AM
Some explanation will be good... I found that into usbd_desc.c file is is generated but I am not sure how I can add my own serial number. Some useful explanation with example will be good.
2021-01-22 03:00 AM
Any number that is persistently stored on the device will do. Could be stored in flash, user option bytes, external eeprom etc.. Just implement the Get_SerialNum(void) function and supply your own variant of deviceserial0 and deviceserial1.
2021-01-22 04:21 AM
It is putting an alpha/numeric identifier in a USB descriptor, how complicated can that be?
Why isn't the current method working for you now?
If you want some linear number space, or particular form you have to manage the allocation and programming of each individual device.
2021-01-22 04:29 AM
If you need to uniquely serialized each device at final test most of the challenge is how you manage that allocation. On the STM32 side you'd likely want to put serialization, configuration, keys and calibration data into FLASH or OTP areas you have set aside for that purpose.
2021-01-23 02:01 PM
@KnarfB Are there any option bytes that are available for random user data? In which STM32 family?
Thanks,
Pavel
2021-01-23 02:21 PM
I'm guessing, but probably Knarf meant OTP, not option bytes.
2021-01-25 12:47 AM
Not really/many, but they do exist. For example some F0 (RM0091) have 2 bytes of user data. That's okay for 2^16 boards.
On some F7 (RM0385) you may use BOOT_ADD1 for that, if the feature is not needed.
2021-01-25 05:15 AM
Thank you KnarfB... I manage to do this....