Skip to content

Commit bbd3f06

Browse files
bors[bot]jodal
andcommitted
Merge #154
154: Update gdb instructions for Ubuntu 18.04+ r=korken89 a=jodal I recently had the pleasure of working my way through the Discovery book. The only stumbling block was that I couldn't find the `gdb-arm-none-eabi` package on Ubuntu 18.04/18.10. I later found that The Embedded Rust Book had more up to date instructions on this part. This PR copies those improvements from `book` to `discovery`. This should fix #91. Co-authored-by: Stein Magnus Jodal <[email protected]>
2 parents 3fc08b7 + a61ddc4 commit bbd3f06

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

src/03-setup/linux.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,34 @@ Here are the installation commands for a few Linux distributions.
44

55
## REQUIRED packages
66

7-
- Ubuntu 16.04 or newer / Debian Jessie or newer
7+
- Ubuntu 18.04 or newer / Debian stretch or newer
8+
9+
> **NOTE** `gdb-multiarch` is the GDB command you'll use to debug your ARM
10+
> Cortex-M programs
11+
12+
<!-- Debian stretch -->
13+
<!-- GDB 7.12 -->
14+
<!-- OpenOCD 0.9.0 -->
15+
16+
<!-- Ubuntu 18.04 -->
17+
<!-- GDB 8.1 -->
18+
<!-- OpenOCD 0.10.0 -->
19+
20+
``` console
21+
$ sudo apt-get install \
22+
gdb-multiarch \
23+
minicom \
24+
openocd
25+
```
26+
27+
- Ubuntu 14.04 and 16.04
28+
29+
> **NOTE** `arm-none-eabi-gdb` is the GDB command you'll use to debug your ARM
30+
> Cortex-M programs
31+
32+
<!-- Ubuntu 14.04 -->
33+
<!-- GDB 7.6 -->
34+
<!-- OpenOCD 0.7.0 -->
835

936
``` console
1037
$ sudo apt-get install \
@@ -15,6 +42,9 @@ $ sudo apt-get install \
1542

1643
- Fedora 23 or newer
1744

45+
> **NOTE** `arm-none-eabi-gdb` is the GDB command you'll use to debug your ARM
46+
> Cortex-M programs
47+
1848
``` console
1949
$ sudo dnf install \
2050
arm-none-eabi-gdb \
@@ -24,12 +54,16 @@ $ sudo dnf install \
2454

2555
- Arch Linux
2656

57+
> **NOTE** `arm-none-eabi-gdb` is the GDB command you'll use to debug ARM
58+
> Cortex-M programs
59+
2760
``` console
2861
$ sudo pacman -S \
2962
arm-none-eabi-gdb \
3063
minicom
3164
```
32-
`openocd` is not availabie in the official Arch repositories, but can be installed from the [AUR](https://aur.archlinux.org/packages/openocd/) or can be compiled from source as follows:
65+
66+
`openocd` is not available in the official Arch repositories, but can be installed from the [AUR](https://aur.archlinux.org/packages/openocd/) or can be compiled from source as follows:
3367

3468
``` console
3569
git clone git://git.code.sf.net/p/openocd/code openocd-code

src/05-led-roulette/flash-it.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ available.
8282
I mentioned that OpenOCD provides a GDB server so let's connect to that right now:
8383

8484
``` console
85-
$ arm-none-eabi-gdb -q target/thumbv7em-none-eabihf/debug/led-roulette
85+
$ <gdb> -q target/thumbv7em-none-eabihf/debug/led-roulette
8686
Reading symbols from target/thumbv7em-none-eabihf/debug/led-roulette...done.
8787
(gdb)
8888
```
8989

90+
**NOTE**: `<gdb>` represents a GDB program capable of debugging ARM binaries.
91+
This could be `arm-none-eabi-gdb`, `gdb-multiarch` or `gdb` depending on your
92+
system -- you may have to try all three.
93+
9094
This only opens a GDB shell. To actually connect to the OpenOCD GDB server, use the following
9195
command within the GDB shell:
9296

0 commit comments

Comments
 (0)