From e136f02ea68787cdffd29c57ed0555a8e90c30ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Wed, 29 May 2024 11:15:39 +0200 Subject: [PATCH] scripts: west_commands: runners: nrfutil: Only flash with J-Links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nrfutil runner calls "nrfutil --json device list" which outputs information about all connected serial ports. The list includes not only actual boards but also any ttyACM instance. If the ttyACM instance does not have serial number, then the nrfutil runner will fail on matching serial number regexp on NoneType. Fix the issue by limiting nrfutil runner board output to only devices that have trait jlink set. Signed-off-by: Tomasz Moń --- scripts/west_commands/runners/nrfutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index a7ff512bb9f..ec1328e4edc 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -77,7 +77,7 @@ class NrfUtilBinaryRunner(NrfBinaryRunner): for o in out: if o['type'] == 'task_end': devs = o['data']['data']['devices'] - snrs = [dev['serialNumber'] for dev in devs] + snrs = [dev['serialNumber'] for dev in devs if dev['traits']['jlink']] self.logger.debug(f'Found boards: {snrs}') return snrs