diff --git a/UsingRTT.md b/UsingRTT.md
index 998c9fc2289..24f664cb2ba 100644
--- a/UsingRTT.md
+++ b/UsingRTT.md
@@ -24,7 +24,7 @@ In another window open a debugger:
```
$ gdb
(gdb) target extended-remote /dev/ttyBmpGdb
-(gdb) monitor swdp_scan
+(gdb) monitor swd_scan
(gdb) attach 1
(gdb) monitor rtt
(gdb) run
@@ -154,7 +154,7 @@ As an example, if the RTT identifier is "IDENT STR":
```
$ gdb
(gdb) target extended-remote /dev/ttyBmpGdb
-(gdb) monitor swdp_scan
+(gdb) monitor swd_scan
(gdb) attach 1
(gdb) monitor rtt ident IDENT_STR
(gdb) monitor rtt
@@ -183,7 +183,7 @@ two COM ports. Connect an ansi terminal emulator to the higher numbered of the t
Sample gdb session:
```
(gdb) target extended-remote COM3
-(gdb) monitor swdp_scan
+(gdb) monitor swd_scan
(gdb) attach 1
(gdb) monitor rtt
(gdb) run
@@ -217,7 +217,7 @@ In another window :
```
gdb
(gdb) target extended-remote /dev/ttyBmpGdb
-(gdb) monitor swdp_scan
+(gdb) monitor swd_scan
(gdb) attach 1
(gdb) monitor rtt
(gdb) run
@@ -239,7 +239,7 @@ In another Terminal window, connect gdb to /dev/cu.usbmodemDDCEC9EC1 :
```
gdb
(gdb) target extended-remote /dev/cu.usbmodemDDCEC9EC1
-(gdb) monitor swdp_scan
+(gdb) monitor swd_scan
(gdb) attach 1
(gdb) monitor rtt
(gdb) run
diff --git a/UsingSWO.md b/UsingSWO.md
index c7104f689b3..de10a656672 100644
--- a/UsingSWO.md
+++ b/UsingSWO.md
@@ -135,7 +135,7 @@ Attach to BMP to your PC:
gdb> target extended_remote /dev/ttyBmpGdb # Choose BMP as the remote target
gdb> mon traceswo # Start SWO output
gdb> mon traceswo 115200 # If async SWO is used, set the decoding baud rate that matches the target
-gdb> mon swdp_scan # Scan for the SWD device
+gdb> mon swd_scan # Scan for the SWD device
gdb> attach 1 # Attach to the device
gdb> run # Start the program execution
```
diff --git a/src/command.c b/src/command.c
index 7ef7a39cb56..afae27be582 100644
--- a/src/command.c
+++ b/src/command.c
@@ -21,8 +21,8 @@
* along with this program. If not, see .
*/
-/* This file implements a basic command interpreter for GDB 'monitor'
- * commands.
+/*
+ * This file implements a basic command interpreter for GDB 'monitor' commands.
*/
#include "general.h"
@@ -56,7 +56,7 @@ static bool cmd_version(target_s *t, int argc, const char **argv);
static bool cmd_help(target_s *t, int argc, const char **argv);
static bool cmd_jtag_scan(target_s *target, int argc, const char **argv);
-static bool cmd_swd_scan(target_s *t, int argc, const char **argv);
+static bool cmd_swd_scan(target_s *target, int argc, const char **argv);
static bool cmd_auto_scan(target_s *t, int argc, const char **argv);
static bool cmd_frequency(target_s *t, int argc, const char **argv);
static bool cmd_targets(target_s *t, int argc, const char **argv);
@@ -174,12 +174,13 @@ bool cmd_version(target_s *t, int argc, const char **argv)
char ident[256];
gdb_ident(ident, sizeof(ident));
DEBUG_WARN("%s\n", ident);
+ DEBUG_WARN("Copyright (C) 2010-2023 Black Magic Debug Project\n");
+ DEBUG_WARN("License GPLv3+: GNU GPL version 3 or later \n\n");
#else
gdb_out(BOARD_IDENT);
gdb_outf(", Hardware Version %d\n", platform_hwversion());
- gdb_out("Copyright (C) 2022 Black Magic Debug Project\n");
- gdb_out("License GPLv3+: GNU GPL version 3 or later "
- "\n\n");
+ gdb_out("Copyright (C) 2010-2023 Black Magic Debug Project\n");
+ gdb_out("License GPLv3+: GNU GPL version 3 or later \n\n");
#endif
return true;
@@ -245,9 +246,9 @@ static bool cmd_jtag_scan(target_s *target, int argc, const char **argv)
return true;
}
-bool cmd_swd_scan(target_s *t, int argc, const char **argv)
+bool cmd_swd_scan(target_s *target, int argc, const char **argv)
{
- (void)t;
+ (void)target;
volatile uint32_t targetid = 0;
if (argc > 1)
targetid = strtoul(argv[1], NULL, 0);
@@ -278,7 +279,7 @@ bool cmd_swd_scan(target_s *t, int argc, const char **argv)
if (!scan_result) {
platform_target_clk_output_enable(false);
platform_nrst_set_val(false);
- gdb_out("SW-DP scan failed!\n");
+ gdb_out("SWD scan failed!\n");
return false;
}
@@ -319,7 +320,7 @@ bool cmd_auto_scan(target_s *t, int argc, const char **argv)
if (scan_result)
break;
- gdb_out("SW-DP scan found no devices.\n");
+ gdb_out("SWD scan found no devices.\n");
}
switch (e.type) {
case EXCEPTION_TIMEOUT:
diff --git a/src/platforms/hosted/cli.c b/src/platforms/hosted/cli.c
index b4b1a059466..64cf66434ac 100644
--- a/src/platforms/hosted/cli.c
+++ b/src/platforms/hosted/cli.c
@@ -429,7 +429,7 @@ bool scan_for_targets(const bmda_cli_options_s *const opt)
DEBUG_WARN("JTAG scan found no devices, trying SWD.\n");
if (bmda_swd_scan(opt->opt_targetid))
return true;
- DEBUG_ERROR("SW-DP scan failed!\n");
+ DEBUG_ERROR("SWD scan failed!\n");
return false;
}
diff --git a/src/target/adiv5.h b/src/target/adiv5.h
index ed9ddb1025f..bba59d87886 100644
--- a/src/target/adiv5.h
+++ b/src/target/adiv5.h
@@ -222,7 +222,6 @@
typedef struct adiv5_access_port adiv5_access_port_s;
typedef struct adiv5_debug_port adiv5_debug_port_s;
-/* Try to keep this somewhat absract for later adding SW-DP */
struct adiv5_debug_port {
int refcnt;
diff --git a/src/target/adiv5_swd.c b/src/target/adiv5_swd.c
index d1510fbb48a..bebc3a9e3f5 100644
--- a/src/target/adiv5_swd.c
+++ b/src/target/adiv5_swd.c
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*/
-/* This file implements the SW-DP specific functions of the
+/*
+ * This file implements the SWD specific functions of the
* ARM Debug Interface v5 Architecture Specification, ARM doc IHI0031A.
*/
@@ -109,15 +110,18 @@ static void jtag_to_swd_sequence()
*/
/* ARM deprecates use of these sequences on devices where the dormant state of operation is implemented */
- DEBUG_WARN("Deprecated TAG-to-SWD sequence\n");
+ DEBUG_WARN("Deprecated JTAG to SWD sequence\n");
/* SWD interface must be in reset state */
swd_line_reset_sequence(false);
- /* Send the 16-bit JTAG-to-SWD select sequence on SWDIOTMS */
+ /* Send the 16-bit JTAG-to-SWD select sequence on SWDIO/TMS */
swd_proc.seq_out(ADIV5_JTAG_TO_SWD_SELECT_SEQUENCE, 16U);
- /* This ensures that if SWJ-DP was already in SWD operation before sending the select sequence, the interface enters reset state */
+ /*
+ * This ensures that if a SWD/JTAG DP was already in SWD operation before sending the select sequence,
+ * the interface enters reset state
+ */
swd_line_reset_sequence(true);
}
@@ -272,12 +276,12 @@ bool adiv5_swd_scan(const uint32_t targetid)
* have never seen before. However, if the debug tools can be provided with the target ID of such targets by the user
* then the contents of the target can be auto-detected as normal.
* To protect against multiple selected devices all driving the line simultaneously SWD protocol version 2 requires:
- * - For multi-drop SWJ-DP, the JTAG connection is selected out of powerup reset. JTAG does not drive the line.
- * - For multi-drop SW-DP, the DP is in the dormant state out of powerup reset.
+ * - For multi-drop SWD/JTAG DPs, the JTAG connection is selected out of powerup reset. JTAG does not drive the line.
+ * - For multi-drop SWD DPs, the DP is in the dormant state out of powerup reset.
*/
void adiv5_swd_multidrop_scan(adiv5_debug_port_s *const dp, const uint32_t targetid)
{
- DEBUG_INFO("Handling swd multi-drop, TARGETID 0x%08" PRIx32 "\n", targetid);
+ DEBUG_INFO("Handling SWD multi-drop, TARGETID 0x%08" PRIx32 "\n", targetid);
/* Scan all 16 possible instances (4-bit instance ID) */
for (size_t instance = 0; instance < 16U; instance++) {
diff --git a/src/target/jtag_scan.c b/src/target/jtag_scan.c
index d3fc1e458f4..c28b2daec8b 100644
--- a/src/target/jtag_scan.c
+++ b/src/target/jtag_scan.c
@@ -83,7 +83,8 @@ bool jtag_scan(void)
/*
* Initialise the JTAG backend if it's not already
- * This will automatically do the SWD-to-JTAG sequence just in case we've got any SWJ-DP's in chain
+ * This will automatically do the SWD-to-JTAG sequence just in case we've got
+ * any SWD/JTAG DPs in the chain
*/
DEBUG_INFO("Resetting TAP\n");
#if PC_HOSTED == 1