Skip to content

Commit 0b94f36

Browse files
committed
edited back matter
1 parent 535ce0e commit 0b94f36

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

mdbook/src/appendix/1-general-troubleshooting/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# General troubleshooting
22

33
## `cargo-embed` problems
4-
Most `cargo-embed` problems are either related to not having installed the `udev`
5-
rules properly (on Linux) or having selected the wrong chip configuration in `Embed.toml` so
6-
make sure you got both of those right.
74

8-
If the above does not work out for you, you can open an issue in the [`discovery` issue tracker].
9-
Alternatively you can also visit the [Rust Embedded matrix channel] or the [probe-rs matrix channel]
10-
and ask for help there.
5+
Most `cargo-embed` problems are related to not having installed the `udev` rules properly on
6+
Linux, so make sure you got that right.
7+
8+
If you are stuck, you can open an issue in the [`discovery` issue tracker] or visit the [Rust
9+
Embedded matrix channel] or the [probe-rs matrix channel] and ask for help there.
1110

1211
[`discovery` issue tracker]: https://github.com/rust-embedded/discovery/issues
1312
[Rust Embedded matrix channel]: https://matrix.to/#/#rust-embedded:matrix.org
@@ -17,7 +16,7 @@ and ask for help there.
1716

1817
### "can't find crate for `core`"
1918

20-
#### Symptoms
19+
*Symptoms:*
2120

2221
```
2322
Compiling volatile-register v0.1.2
@@ -42,11 +41,11 @@ error: Could not compile `r0`.
4241
To learn more, run the command again with --verbose.
4342
```
4443

45-
#### Cause
44+
*Cause:*
4645

4746
You forgot to install the proper target for your microcontroller `thumbv7em-none-eabihf`.
4847

49-
#### Fix
48+
*Fix:*
5049

5150
Install the proper target.
5251

mdbook/src/appendix/2-how-to-use-gdb/README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# How to use GDB
22

3-
Below are some useful GDB commands that can help us debug our programs. This assumes you have [flashed a program](../../05-led-roulette/flash-it.md) onto your microcontroller and attached GDB to a `cargo-embed` session.
3+
Below are some useful GDB commands that can help us debug our programs. This assumes you have
4+
[flashed a program](../../05-led-roulette/flash-it.md) onto your microcontroller and attached GDB to
5+
a `cargo-embed` session.
46

57
## General Debugging
68

7-
> **NOTE:** Many of the commands you see below can be executed using a short form. For example, `continue` can simply be used as `c`, or `break $location` can be used as `b $location`. Once you have experience with the commands below, try to see how short you can get the commands to go before GDB doesn't recognize them!
9+
> **NOTE:** Many of the commands you see below can be executed using a short form. For example,
10+
> `continue` can simply be used as `c`, or `break $location` can be used as `b $location`. Once you
11+
> have experience with the commands below, try to see how short you can get the commands to go
12+
> before GDB doesn't recognize them!
813
914

1015
### Dealing with Breakpoints
@@ -40,7 +45,8 @@ Below are some useful GDB commands that can help us debug our programs. This ass
4045

4146
### Printing Information
4247

43-
* `print /$f $data` - Print the value contained by the variable `$data`. Optionally format the output with `$f`, which can include:
48+
* `print /$f $data` - Print the value contained by the variable `$data`. Optionally format the
49+
output with `$f`, which can include:
4450
```txt
4551
x: hexadecimal
4652
d: signed decimal
@@ -52,21 +58,25 @@ Below are some useful GDB commands that can help us debug our programs. This ass
5258
f: floating point
5359
```
5460
* `print /t 0xA`: Prints the hexadecimal value `0xA` as binary (0b1010)
55-
* `x /$n$u$f $address`: Examine memory at `$address`. Optionally, `$n` define the number of units to display,
56-
`$u` unit size (bytes, halfwords, words, etc.), `$f` any `print` format defined above
61+
62+
* `x /$n$u$f $address`: Examine memory at `$address`. Optionally, `$n` define the number of units to
63+
display, `$u` unit size (bytes, halfwords, words, etc.), `$f` any `print` format defined above
5764
* `x /5i 0x080012c4`: Print 5 machine instructions staring at address `0x080012c4`
5865
* `x/4xb $pc`: Print 4 bytes of memory starting where `$pc` currently is pointing
5966
* `disassemble $location`
60-
* `disassemble /r main`: Disassemble the function `main`, using `/r` to show the bytes that make up each instruction
67+
* `disassemble /r main`: Disassemble the function `main`, using `/r` to show the bytes that make
68+
up each instruction
6169
6270
6371
### Looking at the Symbol Table
6472
65-
* `info functions $regex`: Print the names and data types of functions matched by `$regex`, omit `$regex` to print all functions
73+
* `info functions $regex`: Print the names and data types of functions matched by `$regex`, omit
74+
`$regex` to print all functions
6675
* `info functions main`: Print names and types of defined functions that contain the word `main`
6776
* `info address $symbol`: Print where `$symbol` is stored in memory
6877
* `info address GPIOC`: Print the memory address of the variable `GPIOC`
69-
* `info variables $regex`: Print names and types of global variables matched by `$regex`, omit `$regex` to print all global variables
78+
* `info variables $regex`: Print names and types of global variables matched by `$regex`, omit
79+
`$regex` to print all global variables
7080
* `ptype $data`: Print more detailed information about `$data`
7181
* `ptype cp`: Print detailed type information about the variable `cp`
7282
@@ -79,7 +89,8 @@ Below are some useful GDB commands that can help us debug our programs. This ass
7989
* `down $n`: Select frame `$n` frames down
8090
* `info frame $address`: Describe frame at `$address`, omit `$address` for currently selected frame
8191
* `info args`: Print arguments of selected frame
82-
* `info registers $r`: Print the value of register `$r` in selected frame, omit `$r` for all registers
92+
* `info registers $r`: Print the value of register `$r` in selected frame, omit `$r` for all
93+
registers
8394
* `info registers $sp`: Print the value of the stack pointer register `$sp` in the current frame
8495
8596
### Controlling `cargo-embed` Remotely

mdbook/src/appendix/3-mag-calibration/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describes the procedure if you are interested in the details.
1515

1616
[Design Note]: https://www.st.com/resource/en/design_tip/dt0103-compensating-for-magnetometer-installation-error-and-hardiron-effects-using-accelerometerassisted-2d-calibration-stmicroelectronics.pdf
1717

18-
Luckily for us, the CODAL group that built the original software for the micro:bit already
18+
Luckily for us, the CODAL group that built the original C++ software for the micro:bit already
1919
implemented the manufacturer calibration mechanism (or something similar) in C++ over [here].
2020

2121
[here]: https://github.com/lancaster-university/codal-microbit-v2/blob/006abf5566774fbcf674c0c7df27e8a9d20013de/source/MicroBitCompassCalibrator.cpp
@@ -26,7 +26,7 @@ when reading calibrated values *the axes are flipped* so that viewed from the to
2626
connector forward the X, Y and Z axes of the calibrated value are in "standard" (right, forward, up)
2727
orientation.
2828

29-
The usage of this calibrator is demonstrated in the default `src/main.rs` file.
29+
The usage of this calibrator is demonstrated in `src/main.rs` here.
3030

3131
The way the user does the calibration is shown in this video from the C++ version. (Ignore the
3232
initial printing — the calibration starts about halfway through.)

0 commit comments

Comments
 (0)