File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -2459,15 +2459,29 @@ def detect():
2459
2459
# Prepare environment variables
2460
2460
env = program .get_env ()
2461
2461
2462
- popen ([python_cmd , '-u' , os .path .join (tools_dir , 'detect_targets.py' )]
2463
- + args ,
2464
- env = env )
2462
+ try :
2463
+ pquery ([python_cmd , '-u' , os .path .join (tools_dir , 'detect_targets.py' )]
2464
+ + args ,
2465
+ env = env )
2466
+ except ProcessException as e :
2467
+ error ("Failed to correctly detect all targets (run with '-vv' for more information)" )
2468
+ if very_verbose :
2469
+ error (str (e ))
2465
2470
else :
2466
2471
warning ("The mbed tools were not found in \" %s\" . \n Limited information will be shown about connected mbed targets/boards" % program .path )
2467
2472
targets = program .get_detected_targets ()
2468
2473
if targets :
2474
+ unknown_found = False
2469
2475
for target in targets :
2470
- action ("Detected \" %s\" connected to \" %s\" and using com port \" %s\" " % (target ['name' ], target ['mount' ], target ['serial' ]))
2476
+ if target ['name' ] is None :
2477
+ unknown_found = True
2478
+ action ("Detected unknown target connected to \" %s\" and using com port \" %s\" " % (target ['mount' ], target ['serial' ]))
2479
+ else :
2480
+ action ("Detected \" %s\" connected to \" %s\" and using com port \" %s\" " % (target ['name' ], target ['mount' ], target ['serial' ]))
2481
+
2482
+ if unknown_found :
2483
+ warning ("If you're developing a new target, you can mock the device to continue your development. "
2484
+ "Use 'mbedls --mock ID:NAME' to do so (see 'mbedls --help' for more information)" )
2471
2485
2472
2486
2473
2487
# Generic config command
You can’t perform that action at this time.
0 commit comments