Skip to content

Commit

Permalink
[openocd] Update installation instructions on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaut committed Feb 12, 2024
1 parent ab37430 commit 53f0ead
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions src/emdbg/debug/openocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,43 @@ export PX4_OPENOCD=/path/to/other/openocd

## Installation

OpenOCD works with all STLink debug probes.

On macOS you can simply use Homebrew:

```sh
# Ubuntu
sudo apt install openocd
# macOS
brew install open-ocd
brew install openocd
```

OpenOCD works with all STLink debug probes.
Ubuntu 22.04 only ships with OpenOCD v0.11, which is quite old, so you need to
manually install OpenOCD v0.12:

```sh
wget "https://github.com/rleh/openocd-build/releases/download/0.12.0%2Bdev-snapshot.20230509.1502/openocd-0.12.0.dev.snapshot.20230509.1502.amd64.deb"
sudo dpkg -i openocd-0.12.0.dev.snapshot.20230509.1502.amd64.deb
sudo apt install -f
```

You also need to update the udev rules:

```sh
sudo tee /etc/udev/rules.d/70-st-link.rules > /dev/null <<'EOF'
# ST-LINK V2
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
# ST-LINK V2.1
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
# ST-LINK V3
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="666"
# ST-LINK Serial
SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", MODE="0666", GROUP="dialout"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger
```

[openocd]: https://openocd.org

0 comments on commit 53f0ead

Please sign in to comment.