Skip to content

Commit 456c302

Browse files
committed
Update the shown examples to reflect the new crate version
1 parent 5aad8b3 commit 456c302

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

microbit/src/05-led-roulette/build-it.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ With the `rust-std` component in place you can now cross compile the program usi
4242
# For micro:bit v2
4343
$ cargo build --features v2 --target thumbv7em-none-eabihf
4444
Compiling semver-parser v0.7.0
45-
Compiling typenum v1.12.0
4645
Compiling cortex-m v0.6.3
46+
Compiling proc-macro2 v1.0.85
4747
(...)
48-
Compiling microbit-v2 v0.10.1
49-
Finished dev [unoptimized + debuginfo] target(s) in 33.67s
48+
Compiling microbit-v2 v0.14.0
49+
Finished dev [unoptimized + debuginfo] target(s) in 4.33s
5050

5151
# For micro:bit v1
5252
$ cargo build --features v1 --target thumbv6m-none-eabi
53-
Compiling fixed v1.2.0
54-
Compiling syn v1.0.39
55-
Compiling cortex-m v0.6.3
53+
Compiling semver-parser v0.7.0
54+
Compiling proc-macro2 v1.0.85
55+
Compiling cortex-m v0.7.7
5656
(...)
57-
Compiling microbit v0.10.1
58-
Finished dev [unoptimized + debuginfo] target(s) in 22.73s
57+
Compiling microbit v0.14.0
58+
Finished dev [unoptimized + debuginfo] target(s) in 2.79s
5959
```
6060

6161
> **NOTE** Be sure to compile this crate *without* optimizations. The provided Cargo.toml
@@ -80,16 +80,16 @@ ELF Header:
8080
Type: EXEC (Executable file)
8181
Machine: ARM
8282
Version: 0x1
83-
Entry point address: 0x117
83+
Entry point address: 0x101
8484
Start of program headers: 52 (bytes into file)
85-
Start of section headers: 793112 (bytes into file)
85+
Start of section headers: 777140 (bytes into file)
8686
Flags: 0x5000400
8787
Size of this header: 52 (bytes)
8888
Size of program headers: 32 (bytes)
8989
Number of program headers: 4
9090
Size of section headers: 40 (bytes)
91-
Number of section headers: 21
92-
Section header string table index: 19
91+
Number of section headers: 23
92+
Section header string table index: 21
9393

9494
# For micro:bit v1
9595
# equivalent to `readelf -h target/thumbv6m-none-eabi/debug/led-roulette`
@@ -105,16 +105,16 @@ ELF Header:
105105
Type: EXEC (Executable file)
106106
Machine: ARM
107107
Version: 0x1
108-
Entry point address: 0xC1
108+
Entry point address: 0xA9
109109
Start of program headers: 52 (bytes into file)
110-
Start of section headers: 693196 (bytes into file)
110+
Start of section headers: 776152 (bytes into file)
111111
Flags: 0x5000200
112112
Size of this header: 52 (bytes)
113113
Size of program headers: 32 (bytes)
114114
Number of program headers: 4
115115
Size of section headers: 40 (bytes)
116-
Number of section headers: 22
117-
Section header string table index: 20
116+
Number of section headers: 23
117+
Section header string table index: 21
118118
```
119119

120120
Next, we'll flash the program into our microcontroller.

microbit/src/05-led-roulette/debug-it.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,23 @@ $ gdb target/thumbv6m-none-eabi/debug/led-roulette
4545
> as long as it does not crash, you are fine.
4646
4747
Next we will have to connect to the GDB stub. It runs on `localhost:1337` per default so in order to
48-
connect to it run the following:
48+
connect to it run the following on the gdb commandline (`(gdb)`):
4949
5050
```shell
5151
(gdb) target remote :1337
5252
Remote debugging using :1337
53-
0x00000116 in nrf52833_pac::{{impl}}::fmt (self=0xd472e165, f=0x3c195ff7) at /home/nix/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf52833-pac-0.9.0/src/lib.rs:157
54-
157 #[derive(Copy, Clone, Debug)]
53+
(...)
54+
0x00000100 in cortex_m::delay::Delay::delay_us (self=0xedbeff37, us=439704628) at src/delay.rs:56
55+
56 self.syst.set_reload(ticks - 1);
5556
```
5657
5758
Next what we want to do is get to the main function of our program.
58-
We will do this by first setting a breakpoint there and the continuing
59+
We will do this by first setting a breakpoint there and then continuing
5960
program execution until we hit the breakpoint:
6061
6162
```
6263
(gdb) break main
63-
Breakpoint 1 at 0x104: file src/05-led-roulette/src/main.rs, line 9.
64+
Breakpoint 1 at 0x15c: file src/05-led-roulette/src/main.rs, line 9.
6465
Note: automatically using hardware breakpoints for read-only addresses.
6566
(gdb) continue
6667
Continuing.

0 commit comments

Comments
 (0)