2025-10-16 10:13 AM
Hello,
I am attempting to program many devices (~15-30) using the built-in USB DFU on the STM32U585 in parallel. Using the STM32CubeProgrammer CLI (v2.17.0), I am running the following command to connect the devices:
–-connect port=usb sn=<DFU serial number>
I am performing device programming in a threaded-manner such that each device is put into USB DFU mode and connected to/programmed in parallel.
To create the DFU serial number, I first obtain the 96-bit MCU UUID, combine the first and third 32-bit sections, then concatenating the first 4 MSB of the second section. For example, given UUID 00580027 3331500b 20333153
The resulting DFU serial number 0x208B317A3331 is in line with the DFU serial number detected within STM32CubeProgrammer as well the serial number detected within the USB device manager.
However, producing this DFU serial number diminishes the uniqueness of each device during programming due to the loss of the last 4 bytes of the second word of the UUID (e.g. 500b in 3331500b). In practice, I have ran into the issue where multiple devices have had shared DFU serial numbers causing inconsistencies in programming where devices either fail to program or are programmed with the incorrect binaries.
Are there any work arounds or alternatives to device uniqueness while in DFU mode? Perhaps is it possible to alter the DFU serial number per device to assure uniqueness for each MCU? Or are there any tools that would allow parallel programming aside from using STM32CubeProgrammer CLI?
2025-10-16 11:04 AM
Use a 32 bit hash of the UUID. With 10,000 devices, you have a ~1.2% chance of a collision between any 2 devices.
No way to guarantee uniqueness taking a 96-bit value down to 32-bits. The documentation for fields within the UUID has not been accurate in the past.
When I'm doing this (programming many devices), I have a script that:
And just loops forever. All doable with the STM32CubeProgrammer CLI.
2025-10-16 11:09 AM
Maybe you explain for what you calculate SN , and how is your target? Different bins for every device based on ID?