From 0612f2dc79c36f24ca5323261071a4963cc91bc2 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Thu, 16 Jun 2022 13:07:08 -0400 Subject: [PATCH] hosted: Documented the new command line option and added it to the ZSH completions --- contrib/zsh/_blackmagic | 3 ++- src/platforms/hosted/cli.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/zsh/_blackmagic b/contrib/zsh/_blackmagic index 91758b3..4d786d0 100644 --- a/contrib/zsh/_blackmagic +++ b/contrib/zsh/_blackmagic @@ -48,7 +48,8 @@ arguments=( '(-d -P -s -c)-s=[select the debug probe with the given serial number]:serial' '(-d -P -s -c)-c=[select the FTDI-based debug probe with of the given type]:type' '-n=[select the target device at the given position in the scan chain]:number' - '-j[use JTAG instead of SWD]' + '(-j -A)-j[use JTAG instead of SWD]' + '(-j -A)-A[use automatic chain scanning]' '-C[connect to target under hardware reset]' '(-t -T)-t[perform a chain scan and display information about the conected devices]' '(-t -T)-T[perform continues read- or write-back of a value to allow measurement of protocol timing. Aborted by ^C]' diff --git a/src/platforms/hosted/cli.c b/src/platforms/hosted/cli.c index efe38ee..b97fd4e 100644 --- a/src/platforms/hosted/cli.c +++ b/src/platforms/hosted/cli.c @@ -134,7 +134,7 @@ static void cl_help(char **argv) PRINT_INFO( "\n" "Usage: %s [-h | -l | [-vBITMASK] [-d PATH | -P NUMBER | -s SERIAL | -c TYPE]\n" - "\t[-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]] [-H] [-M STRING ...]\n" + "\t[-n NUMBER] [-j | -A] [-C] [-t | -T] [-e] [-p] [-R[h]] [-H] [-M STRING ...]\n" "\t[-f | -m] [-E | -w | -V | -r] [-a ADDR] [-S number] [file]]\n" "\n" "The default is to start a debug server at localhost:2000\n\n" @@ -153,10 +153,11 @@ static void cl_help(char **argv) "\t type (cable)\n" "\n" "General configuration options: [-n NUMBER] [-j] [-C] [-t | -T] [-e] [-p] [-R[h]]\n" - " [-H] [-M STRING ...]\n" + "\t\t[-H] [-M STRING ...]\n" "\t-n, --number Select the target device at the given position in the\n" "\t scan chain (use the -t option to get a scan chain listing)\n" "\t-j, --jtag Use JTAG instead of SWD\n" + "\t-A, --auto-scan Automatic scanning - try JTAG first, then SWD\n" "\t-C, --hw-reset Connect to target under hardware reset\n" "\t-t, --list-chain Perform a chain scan and display information about the\n" "\t conected devices\n" @@ -206,6 +207,7 @@ static const struct option long_options[] = { {"ftdi-type", required_argument, NULL, 'c'}, {"number", required_argument, NULL, 'n'}, {"jtag", no_argument, NULL, 'j'}, + {"auto-scan", no_argument, NULL, 'A'}, {"hw-reset", no_argument, NULL, 'C'}, {"list-chain", no_argument, NULL, 't'}, {"timing", no_argument, NULL, 'T'},