Skip to content

Commit 7eb7fb7

Browse files
committed
openocd: Describe how to connect to a board by a serial number
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
1 parent 5b3a80d commit 7eb7fb7

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

docs/platforms/use-openocd.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,53 @@ core and aux registers. However some command for register access will be
255255
removed in future, when ARC OpenOCD will fully support flexible register
256256
configurations.
257257

258-
## Using Another GDB Port
258+
## Using another GDB port
259259

260260
You can use an OpenOCD command to change the GDB port this way:
261261

262262
```text
263263
openocd -c "gdb_port 12345" ...
264264
```
265265

266+
## Connecting to a board with a particular serial number
267+
268+
If several boards are connected to the host, then OpenOCD will choose
269+
the first detected one. To choose a board with a particular serial number
270+
it's necessary to create a custom board configuration file and specify
271+
a serial number explicitly.
272+
273+
Here is an example for HSDK (a serial number is set through `ftdi_serial` variable):
274+
275+
```
276+
$ cat snps_hsdk.cfg
277+
source [find interface/ftdi/snps_sdp.cfg]
278+
ftdi_serial "251642000213"
279+
adapter_khz 10000
280+
transport select jtag
281+
source [find target/snps_hsdk.cfg]
282+
init
283+
reset halt
284+
285+
$ openocd -f ./snps_hsdk.cfg
286+
...
287+
```
288+
289+
Here is an example for EM SDP:
290+
291+
```
292+
$ cat snps_em_sk_v2.3.cfg
293+
source [find interface/ftdi/digilent-hs1.cfg]
294+
ftdi_serial "210203826102"
295+
adapter_khz 5000
296+
transport select jtag
297+
source [find target/snps_em_sk_fpga.cfg]
298+
init
299+
reset halt
300+
301+
$ openocd -f ./snps_em_sk_v2.3.cfg
302+
...
303+
```
304+
266305
## Configurations files
267306

268307
Here is a table of configuration files for OpenOCD 0.9:

0 commit comments

Comments
 (0)