Skip to content

Commit

Permalink
Merge #167
Browse files Browse the repository at this point in the history
167: Update linux.md r=korken89 a=flip111

#136

#137

Co-authored-by: flip111 <flip101@gmail.com>
Co-authored-by: Vadim Kaushan <admin@disasm.info>
  • Loading branch information
3 people committed May 2, 2019
2 parents 8f366fe + abb7917 commit 9858872
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 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,14 @@ $ sudo dnf install \
> Cortex-M programs
``` console
$ sudo pacman -S \
arm-none-eabi-gdb \
qemu-arch-extra \
openocd

sudo pacman -S arm-none-eabi-gdb qemu-arch-extra 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 +77,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

0 comments on commit 9858872

Please sign in to comment.