WaitDeviceBoardID times out if device is already connected
WaitDeviceBoardID looks for "ID_SERIAL_SHORT" using context.list_devices() to check if a device is already connected. But for some devices (such as TI CC1352R1 and TI CC3220SF launchpads), the serial number is listed under "HID_UNIQ":
{'DEVPATH': '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.5/0003:0451:BEF3.00A0', 'DRIVER': 'hid-generic', 'HID_ID': '0003:00000451:0000BEF3', 'HID_NAME': 'Texas Instruments XDS110 (03.00.00.11) Embed with CMSIS-DAP', 'HID_PHYS': 'usb-0000:00:1a.0-1.3.2/input5', 'HID_UNIQ': 'E0071009', 'MODALIAS': 'hid:b0003g0001v00000451p0000BEF3', 'SUBSYSTEM': 'hid'}
So if the device was already connected prior to WaitDeviceBoardID being run, it would not find the board.
If WaitDeviceBoardID is called before the board is connected, things work fine given 'ID_SERIAL_SHORT' is indeed used in the udev event:
{'ACTION': 'add', 'BUSNUM': '001', 'DEVNAME': '/dev/bus/usb/001/048', 'DEVNUM': '048', 'DEVPATH': '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3.2', 'DEVTYPE': 'usb_device', 'DRIVER': 'usb', 'ID_BUS': 'usb', 'ID_MODEL': 'XDS110__03.00.00.11__Embed_with_CMSIS-DAP', 'ID_MODEL_ENC': 'XDS110\x20\x2803.00.00.11\x29\x20Embed\x20with\x20CMSIS-DAP', 'ID_MODEL_ID': 'bef3', 'ID_REVISION': '0100', 'ID_SERIAL': 'Texas_Instruments_XDS110__03.00.00.11__Embed_with_CMSIS-DAP_E0071009', 'ID_SERIAL_SHORT': 'E0071009', 'ID_USB_INTERFACES': ':020201:0a0000:ff0000:030000:', 'ID_VENDOR': 'Texas_Instruments', 'ID_VENDOR_ENC': 'Texas\x20Instruments', 'ID_VENDOR_FROM_DATABASE': 'Texas Instruments, Inc.', 'ID_VENDOR_ID': '0451', 'MAJOR': '189', 'MINOR': '47', 'PRODUCT': '451/bef3/100', 'SEQNUM': '55254', 'SUBSYSTEM': 'usb', 'TYPE': '239/2/1', 'USEC_INITIALIZED': '948899037154'}