Commit 3ad2d9fc authored by Guillaume Tucker's avatar Guillaume Tucker

stm32usb: compare serial numbers rather than usb.util.get_string()

When several stm32usb serial consoles are present, comare each USB
device serial number with the micro servo to find the correct one
rather than using the usb.util.get_string() method which appears to be
doing something completely different and never returns a matching
serial number.  The Servo Micro uses such a console, so when
connecting more than one to the same controller the issue occurs.

This issue cannot be seen when only one servo board has a stm32usm
serial device.
Signed-off-by: Guillaume Tucker's avatarGuillaume Tucker <>
parent 0bcda2f6
......@@ -81,7 +81,7 @@ class Susb():
dev = None
if len(dev_list) > 1 and self._serialname is not None:
for d in dev_list:
if usb.util.get_string(d, 256, d.iSerialNumber) == self._serialname:
if d.serial_number == self._serialname:
dev = d
if dev is None:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment