Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyocd/probe/pydapaccess/interface/hidapi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ def read(self):
"""@brief Read data on the IN endpoint associated to the HID interface"""
# Windows doesn't use the read thread, so read directly.
if _IS_WINDOWS:
read_data = bytes(self.device.read(self.packet_size))
# Pass a timeout so the read cannot block forever if the probe stops responding.
read_data = bytes(self.device.read(self.packet_size, timeout_ms=self.DEFAULT_USB_TIMEOUT_MS))
if not read_data:
raise DAPAccessIntf.DeviceError(f"Timeout reading from probe {self.serial_number}")

if TRACE.isEnabledFor(logging.DEBUG):
# Strip off trailing zero bytes to reduce clutter.
Expand Down
Loading