Skip to content

Commit b37d891

Browse files
tmon-nordicanangl
authored andcommitted
[nrf fromtree] scripts: west_commands: runners: nrfutil: Only flash with J-Links
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ń <[email protected]> (cherry picked from commit e136f02)
1 parent 9b2586b commit b37d891

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/west_commands/runners/nrfutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def do_get_boards(self):
7777
for o in out:
7878
if o['type'] == 'task_end':
7979
devs = o['data']['data']['devices']
80-
snrs = [dev['serialNumber'] for dev in devs]
80+
snrs = [dev['serialNumber'] for dev in devs if dev['traits']['jlink']]
8181

8282
self.logger.debug(f'Found boards: {snrs}')
8383
return snrs

0 commit comments

Comments
 (0)