From 2384148361d0c2ee39709b5348628e3bd4b7dc15 Mon Sep 17 00:00:00 2001 From: jaenrig-ifx Date: Thu, 17 Nov 2022 17:38:20 +0100 Subject: [PATCH] tools/pyboard.py: Prevent non-blocking serial reads. Added timeout to avoid blocking call to read() preventing the test runner to wait forever for incoming data from a irresponsive target. Signed-off-by: jaenrig-ifx --- tools/pyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pyboard.py b/tools/pyboard.py index 55c00fbca1944..2dabcc8be9ae8 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -268,7 +268,7 @@ def __init__( import serial # Set options, and exclusive if pyserial supports it - serial_kwargs = {"baudrate": baudrate, "interCharTimeout": 1} + serial_kwargs = {"baudrate": baudrate, "interCharTimeout": 1, "timeout": 10} if serial.__version__ >= "3.3": serial_kwargs["exclusive"] = exclusive