Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linux.md #167

Merged
merged 3 commits into from
May 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 28 additions & 30 deletions src/intro/install/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ Here are the installation commands for a few Linux distributions.
<!-- QEMU 2.11.1 -->

``` console
$ sudo apt install \
gdb-multiarch \
openocd \
qemu-system-arm
sudo apt install gdb-multiarch openocd qemu-system-arm
```

- Ubuntu 14.04 and 16.04
Expand All @@ -37,10 +34,7 @@ $ sudo apt install \
<!-- QEMU 2.0.0 (?) -->

``` console
$ sudo apt install \
gdb-arm-none-eabi \
openocd \
qemu-system-arm
sudo apt install gdb-arm-none-eabi openocd qemu-system-arm
```

- Fedora 27 or newer
Expand All @@ -54,10 +48,7 @@ $ sudo apt install \
<!-- QEMU 2.10.2 -->

``` console
$ sudo dnf install \
arm-none-eabi-gdb \
openocd \
qemu-system-arm
sudo dnf install arm-none-eabi-gdb openocd qemu-system-arm
```

- Arch Linux
Expand All @@ -66,22 +57,16 @@ $ sudo dnf install \
> Cortex-M programs

``` console
$ sudo pacman -S \
arm-none-eabi-gdb \
qemu-arch-extra

$ # install openocd from the AUR -- https://aur.archlinux.org/packages/openocd/
sudo pacman -S arm-none-eabi-gdb qemu-arch-extra
```

Now install openocd from [AUR](https://aur.archlinux.org/packages/openocd/)

## udev rules

This rule lets you use OpenOCD with the Discovery board without root privilege.

Create this file in `/etc/udev/rules.d` with the contents shown below.

``` console
$ cat /etc/udev/rules.d/70-st-link.rules
```
Create the file `/etc/udev/rules.d/70-st-link.rules` with the contents shown below.

``` text
# STM32F3DISCOVERY rev A/B - ST-LINK/V2
Expand All @@ -94,28 +79,41 @@ ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", TAG+="uaccess"
Then reload all the udev rules with:

``` console
$ sudo udevadm control --reload-rules
sudo udevadm control --reload-rules
```

If you had the board plugged to your laptop, unplug it and then plug it again.

You can check the permissions by running these commands:
You can check the permissions by running this command:

``` console
$ lsusb
lsusb
```

Which should show something like

```text
(..)
Bus 001 Device 018: ID 0483:374b STMicroelectronics ST-LINK/V2.1
(..)
```

Take note of the bus and device numbers. Use those numbers in the following
command:
Take note of the bus and device numbers. Use those numbers to create a path like
`/dev/bus/usb/<bus>/<device>`. Then use this path like so:

``` console
$ # the format of the path is /dev/bus/usb/<bus>/<device>
$ ls -l /dev/bus/usb/001/018
ls -l /dev/bus/usb/001/018
```

```text
crw-------+ 1 root root 189, 17 Sep 13 12:34 /dev/bus/usb/001/018
$ getfacl /dev/bus/usb/001/018 | grep user
```

```console
getfacl /dev/bus/usb/001/018 | grep user
```

```text
user::rw-
user:you:rw-
```
Expand Down