Skip to content

Commit

Permalink
[docs] Improve installation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaut committed Oct 27, 2023
1 parent f58e522 commit 4383577
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.3.2

- Improve installation guides for GDB and CrashDebug.
- Create a new `trace.swo` file when using OpenOCD instead of appending.
- Fix broken ITM tracing macro.

Expand Down
18 changes: 17 additions & 1 deletion src/emdbg/debug/crashdebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,23 @@ passed a NULL pointer from inside `uORB::DeviceNode::write`.
## Installation

You need to have the [platform-specific `CrashDebug` binary][binary] available
in your path, alternatively you can specify the binary path in your environment:
in your path:

```sh
# x86_64 macOS
curl -L https://github.com/adamgreen/CrashDebug/raw/master/bins/osx64/CrashDebug \
/usr/local/bin/CrashDebug
# Clear the quarantine flag
sudo xattr -r -d com.apple.quarantine /usr/local/bin/CrashDebug

# ARM64 macOS
curl -L https://github.com/adamgreen/CrashDebug/raw/master/bins/osx64/CrashDebug \
/opt/homebrew/bin/CrashDebug
# Clear the quarantine flag
sudo xattr -r -d com.apple.quarantine /opt/homebrew/bin/CrashDebug
```

Alternatively you can specify the binary path in your environment:

```sh
export PX4_CRASHDEBUG_BINARY=path/to/CrashDebug
Expand Down
30 changes: 20 additions & 10 deletions src/emdbg/debug/gdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,43 @@ We strongly recommend to *only* symlink the `arm-none-eabi-gdb-py3` binary into
your path, and keep the remaining `arm-none-eabi-gcc` at v9 as done for PX4.

```sh
sudo mkdir -p /opt/xpack
sudo -u {username} mkdir -p /opt/xpack
curl -L https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v12.2.1-1.2/xpack-arm-none-eabi-gcc-12.2.1-1.2-linux-x64.tar.gz | \
sudo tar -xvzf - -C /opt/xpack/
tar -xvzf - -C /opt/xpack/
# Only link the -py3 into your path
sudo ln -s /opt/xpack/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gdb-py3 \
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin
ln -s /opt/xpack/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gdb-py3 \
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb-py3
```

On macOS you additionally need to clear the quarantine flags after expansion:

```sh
sudo mkdir -p /opt/xpack
sudo -u {username} mkdir -p /opt/xpack

# x86_64 binary
curl -L https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v12.2.1-1.2/xpack-arm-none-eabi-gcc-12.2.1-1.2-darwin-x64.tar.gz | \
sudo tar -xvzf - -C /opt/xpack/
tar -xvzf - -C /opt/xpack/
# ARM64 binary
curl -L https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v12.2.1-1.2/xpack-arm-none-eabi-gcc-12.2.1-1.2-darwin-arm64.tar.gz | \
sudo tar -xvzf - -C /opt/xpack/
tar -xvzf - -C /opt/xpack/

# Clear the quarantine flag
sudo xattr -r -d com.apple.quarantine /opt/xpack/

# Only link the -py3 into your path
sudo ln -s /opt/xpack/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gdb-py3 \
/usr/local/bin
```
# x86_64 path
ln -s /opt/xpack/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gdb-py3 \
/usr/local/bin/arm-none-eabi-gdb-py3
# ARM64 path
ln -s /opt/xpack/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gdb-py3 \
/opt/homebrew/bin/arm-none-eabi-gdb-py3
```

> **Note**
> You need to have the Rosetta emulation layer installed on ARM64 macOS:
> ```sh
> softwareupdate --install-rosetta --agree-to-license
> ```
## Command Line Interface
Expand Down

0 comments on commit 4383577

Please sign in to comment.