2025-10-31 8:08 AM
When connecting via USB to a STM32 board in DFU mode, it is possible to read a serial number from the instance path.
However, in runtime, the serial number exposed via USB must be programed by the user... It would be nice then if ST provided the algorithm they used to create this string.
We do have some hints though. When generating a STCube project, by default a `Get_SerialNum` function is generated in usbd_desc.c.
However, it does not produce the same string as the bootloader does.
Can anyone please tell us what is the algorithm stored in ROM of each type STM32 to generate the USB serial number string based on the 96-bit UID?
On STM32F76/STM32F77, I have found that this function outputs a string that matches the one produced in ROM:
`static void Get_SerialNum(void)
