Skip to content

Commit

Permalink
docs: add macOS development tools setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwen-tw committed Dec 1, 2023
1 parent 0251264 commit d6bb212
Showing 1 changed file with 103 additions and 4 deletions.
107 changes: 103 additions & 4 deletions docs/1-environment_setup.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Development Tools Setup
=======================

Build requirement: `GNU/Linux x86-64` and `python3`
## Linux

Tested with `Ubuntu 22.04`.
Recommended distribution: `Ubuntu 22.04`

### 1. Prerequisites:

Expand Down Expand Up @@ -41,7 +41,7 @@ make -j $(nproc)
sudo make install
```

### 4. ARM GNU toolchain 12.3:
### 4. ARM GNU toolchain 12.3 (x86-64):

Download the pre-built ARM GNU toolchain:

Expand All @@ -59,4 +59,103 @@ PATH=$PATH:${YOUR_PATH}/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi/bin

Note that `Python 3.8` is a hard requirement for running version `12.3` of `arm-none-eabi-gdb`.

### 5. Restart the terminal
Execute the following command or restart the terminal:

```
source ~/.bashrc
```

---

## macOS

> Caveat: rtplot and Gazebo are not yet fully tested on macOS
### 1. Prerequisites:

```
brew install git cgdb curl wget python@3.8 texinfo automake pkg-config \
libtool libusb pixman glib ncurses ninja flex bison
```

### 2. OpenOCD:

Install `libjaylink`:

```
https://repo.or.cz/libjaylink.git
git clone https://gitlab.zapb.de/libjaylink/libjaylink.git
cd libjaylink
./autogen.sh
./configure
make
make install
```

Install `OpenOCD`:

```
git clone https://github.com/openocd-org/openocd.git
cd openocd
./bootstrap
./configure --prefix=/usr/local --enable-jlink --enable-buspirate \
--enable-stlink --disable-libftdi
make -j$(sysctl -n hw.ncpu)
make install
```

### 3. QEMU:

```
git clone https://github.com/qemu/qemu.git
cd qemu
git submodule update --init --recursive
mkdir build
cd build
../configure
make -j$(sysctl -n hw.ncpu)
make install
```

### 4. ARM GNU toolchain 12.3:

**macOS (AArch64):**

Download the pre-built ARM GNU toolchain:

```
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz
tar xf arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz
```
Append the following instruction in the `~/.zshrc`:

```
PATH=$PATH:${PATH}/arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi/bin
```

Execute the following command or restart the terminal:

```
source ~/.zshrc
```

**macOS (x86-64):**

Download the pre-built ARM GNU toolchain:

```
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz
tar xf arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz
```

Append the following instruction in the `~/.zshrc`:

```
PATH=$PATH:${PATH}/arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi/bin
```

Execute the following command or restart the terminal:

```
source ~/.zshrc
```

0 comments on commit d6bb212

Please sign in to comment.