You can download openocd from the official github mirror Release page This relase does not require admin access to be used. Everything is already compiled and run from inside the folder.
You can install from APT or from sources. That's a lot easier !
To link openocd to your project, you can create a cfg file in your project folder. This file is basically just a script in the openocd format that is passed to openocd at the execution.
In this script, you want to provide the informations of your probe and the ARM device.
Example of config file to setup communication to an ATSAMC21E18 with a Atmel-ICE JTAG/SWD in-circuit debugger:
# Atmel-ICE JTAG/SWD in-circuit debugger.
# interface cmsis-dap
# cmsis_dap_vid_pid 0x03eb 0x2141
source [find interface/cmsis-dap.cfg]
# Chip info
set CHIPNAME at91samc21e18
source [find target/at91samdXX.cfg]
bindto 0.0.0.0
init
This script setup:
- a GDB server on port 3333 (default)
- a telnet server on port 4444 (default)
- open those interfaces to be reachable from the network
-
source [find interface/cmsis-dap.cfg]
Source the cmsis-dap.cfg to communicate with a generic ARM compatible jtag/swd interface. -
set CHIPNAME at91samc21e18
Set a variable nameCHIPNAME
containing the precise reference of the chip. -
source [find target/at91samdXX.cfg]
Source the generic target file for the atsam chips. -
bindto 0.0.0.0
This line open the openocd socket to outsid of the computer. You need to add this line if you want to connect to a running instance of openocd from another commputer. -
init
Start the openocd init routine.
You can flash your binary with openocd with the line program app.hex verify reset exit
Use the command line to run openocd with the command:
<path_to_openocd>/openocd -f <your_cfg>