Skip to content

Commit 845bde6

Browse files
committed
Fix: add serial monitor reminders for not/ wrong selected serial port
1 parent c2299b1 commit 845bde6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/xmc-flasher.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ def parser_upload_func(args):
267267
else:
268268
print("Upload failed.")
269269
remove_console_output_file(console_out)
270+
# Log if the port value has changed
271+
if args.port != original_port:
272+
print(f"Please select port {args.port} for using the Serial Monitor or Plotter.")
273+
270274

271275
def parser_erase_func(args):
272276
erase(args.device, args.port)
@@ -312,6 +316,9 @@ def __call__(self, parser, namespace, values, option_string, **kwargs):
312316
else:
313317
sys.tracebacklimit = 0 # Disable traceback
314318

319+
# Store the original port value
320+
original_port = args.port
321+
315322
# Select default port if not provided/ or device not found on the selected port
316323
args.port = get_default_port(args.port)
317324

0 commit comments

Comments
 (0)