aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorManuel Wick <manuel@matronix.de>2021-01-30 22:46:50 +0100
committerTomas Vanek <vanekt@fbl.cz>2023-12-03 06:22:54 +0000
commit0f70c6c325785517f35bbbb9316801bef7a79d8b (patch)
tree213f524638bd03f22af29106caed9b5684fbad1a /doc
parent119a5338623d77bbdbc37b6ecb5e93df3368af30 (diff)
downloadriscv-openocd-0f70c6c325785517f35bbbb9316801bef7a79d8b.zip
riscv-openocd-0f70c6c325785517f35bbbb9316801bef7a79d8b.tar.gz
riscv-openocd-0f70c6c325785517f35bbbb9316801bef7a79d8b.tar.bz2
remote_bitbang: Add SWD support
This adds new command characters to make SWD work with the new split jtag and swd operations of bitbang. The command characters are as follows: O - SWDIO drive 1 o - SWDIO drive 0 c - SWDIO read request d - SWD write 0 0 e - SWD write 0 1 f - SWD write 1 0 g - SWD write 1 1 Documentation has been updated accordingly. The new commands will be used by an adapted version of the jtag-openocd applet of the "Glasgow Debug Tool" (https://github.com/glasgowEmbedded/Glasgow). It has been tested against an stm32f103 and an at91samd21 target. contrib/remote/bitbang/remote_bitbang_sysfsgpio.c has also been adapted to support SWD via the new command set. Some limited testing has been done using a Raspberry Pi 2 with an stm32f103 and an at91samd21 target attached. Change-Id: I8e998a2cb36905142cb16e534483094cd99e8fa7 Signed-off-by: Manuel Wick <manuel@matronix.de> Signed-off-by: David Ryskalczyk <david.rysk@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6044 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/jtag/drivers/remote_bitbang.txt36
-rw-r--r--doc/openocd.texi6
2 files changed, 31 insertions, 11 deletions
diff --git a/doc/manual/jtag/drivers/remote_bitbang.txt b/doc/manual/jtag/drivers/remote_bitbang.txt
index f394d73..7c8eee2 100644
--- a/doc/manual/jtag/drivers/remote_bitbang.txt
+++ b/doc/manual/jtag/drivers/remote_bitbang.txt
@@ -1,15 +1,19 @@
/** @remote_bitbangpage OpenOCD Developer's Guide
-The remote_bitbang JTAG driver is used to drive JTAG from a remote process. The
-remote_bitbang driver communicates via TCP or UNIX sockets with some remote
-process using an ASCII encoding of the bitbang interface. The remote process
-presumably then drives the JTAG however it pleases. The remote process should
-act as a server, listening for connections from the openocd remote_bitbang
-driver.
+The remote_bitbang JTAG+SWD driver is used to drive JTAG and/or SWD from a
+remote process. The remote_bitbang driver communicates via TCP or UNIX
+sockets with some remote process using an ASCII encoding of the bitbang
+interface. The remote process presumably then drives the JTAG/SWD however
+it pleases. The remote process should act as a server, listening for
+connections from the openocd remote_bitbang driver.
The remote bitbang driver is useful for debugging software running on
processors which are being simulated.
+There also is an implementation of the server-side protocol for the
+Glasgow Debug Tool (https://github.com/glasgowEmbedded/Glasgow) through
+the jtag-openocd applet.
+
The bitbang interface consists of the following functions.
blink on
@@ -24,11 +28,20 @@ write tck tms tdi
reset trst srst
Set the value of trst, srst.
+swdio_drive
+ Set the output enable of the bidirectional swdio (tms) pin
+
+swdio_read
+ Sample the value of swdio (tms).
+
+swd_write
+ Set the value of swclk (tck) and swdio (tms).
+
An additional function, quit, is added to the remote_bitbang interface to
indicate there will be no more requests and the connection with the remote
driver should be closed.
-These five functions are encoded in ASCII by assigning a single character to
+These eight functions are encoded in ASCII by assigning a single character to
each possible request. The assignments are:
B - Blink on
@@ -47,7 +60,14 @@ each possible request. The assignments are:
s - Reset 0 1
t - Reset 1 0
u - Reset 1 1
+ O - SWDIO drive 1
+ o - SWDIO drive 0
+ c - SWDIO read request
+ d - SWD write 0 0
+ e - SWD write 0 1
+ f - SWD write 1 0
+ g - SWD write 1 1
-The read response is encoded in ASCII as either digit 0 or 1.
+The read responses are encoded in ASCII as either digit 0 or 1.
*/
diff --git a/doc/openocd.texi b/doc/openocd.texi
index c14ee9c..de990c5 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -2810,9 +2810,9 @@ If not specified, default 0xFFFF is used.
@end deffn
@deffn {Interface Driver} {remote_bitbang}
-Drive JTAG from a remote process. This sets up a UNIX or TCP socket connection
-with a remote process and sends ASCII encoded bitbang requests to that process
-instead of directly driving JTAG.
+Drive JTAG and SWD from a remote process. This sets up a UNIX or TCP socket
+connection with a remote process and sends ASCII encoded bitbang requests to
+that process instead of directly driving JTAG and SWD.
The remote_bitbang driver is useful for debugging software running on
processors which are being simulated.