blob: 8316cb0dd53a8fcb5ca0d036d4821b751b1b1e87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/** @remote_bitbangpage OpenOCD Developer's Guide
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
Blink a light somewhere. The argument on is either 1 or 0.
read
Sample the value of tdo.
write tck tms tdi
Set the value of tck, tms, and 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).
(optional) sleep
Instructs the remote host to sleep/idle for some period of time before
executing the next request
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.
The eight mandatory functions are encoded in ASCII by assigning a single
character to each possible request. The assignments are:
B - Blink on
b - Blink off
R - Read request
Q - Quit request
0 - Write 0 0 0
1 - Write 0 0 1
2 - Write 0 1 0
3 - Write 0 1 1
4 - Write 1 0 0
5 - Write 1 0 1
6 - Write 1 1 0
7 - Write 1 1 1
r - Reset 0 0
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 responses are encoded in ASCII as either digit 0 or 1.
If the use_remote_sleep option is set to 'yes', two additional requests may
be sent:
Z - Sleep for 1 millisecond
z - Sleep for 1 microsecond
NOTE: Previously these were specified as 'D' and 'd', which conflicts with the
"SWD write 0 0" command defined above. Adapters that implement Dd for remote
sleep must be updated to work with Zz.
*/
|