Parallel Programming over USB DFU using STM32CubeProgrammer CLI
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
- Combining 0x00580027 and 0x20333153 yields 0x208B317A
- Then concatenating the first 4 MSB of 0x3331500b yields 0x208B317A3331
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?
