Skip to content

Commit c521c13

Browse files
more
1 parent 3a0ac66 commit c521c13

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

.cargo/config

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# vim:ft=toml:
22
[target.thumbv7em-none-eabihf]
3+
#runner = 'arm-none-eabi-gdb'
34
runner = "probe-run --chip nRF52840_xxAA"
5+
46
rustflags = [
57
"-C", "link-arg=-Tlink.x",
68
]

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ nrf52840-hal = "0.11.0"
1515
[dev-dependencies]
1616
cortex-m-rt = "0.6.13"
1717
panic-halt = "0.2"
18-
rtt-target = { version = "0.2.2", features = ["cortex-m"] }
19-
panic-probe = { git = "https://github.com/knurling-rs/probe-run", branch = "main" }
18+
rtt-target = { version = "0.3.0", features = ["cortex-m"] }
19+
panic-probe = { version = "0.1.0", branch = "main" }
2020

2121
# for cargo flash
2222
[package.metadata]

README.md

+18-20
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
https://github.com/makerdiary/nrf52840-mdk
44

5-
## flashing and printing with probe-run
5+
## flashing with cargo flash
66

7-
This is the recommended way to go.
7+
This is the recommended way to go for flashing
88

9-
* Install the dependencies for[probe-run](https://crates.io/crates/probe-run)
9+
* Install the dependencies for[cargo-flash](https://crates.io/crates/cargo-flash)
10+
* Install probe-run `cargo install cargo-flash`
11+
12+
Then simply `cargo flash --release --example blinky`
13+
14+
## debugging with probe-run
15+
16+
This is the recommended way to go for debugging
17+
18+
* Install the dependencies for[probe-run](https://crates.io/crates/probe-run) (same as for cargo-flash if you already have that)
1019
* Install probe-run `cargo install probe-run`
1120
* On linux you need udev rules saved to somewhere like /etc/udev/rules.d/50-cmsis-dap.rules
1221

@@ -40,30 +49,15 @@ stack backtrace:
4049
9: 0x00000156 - Reset
4150
```
4251

43-
Note fresh out of the box devices seem to need to be erased
44-
45-
```bash
46-
Error: Error while flashing
47-
Caused by:
48-
The execution of 'erase_sector' failed with code 103
49-
```
50-
51-
Install some other tool like cargo-flash or pyocd one time and
52-
53-
```bash
54-
pip3 install pyocd
55-
pyocd erase -t nrf52840 --chip
56-
```
57-
58-
## OpenOCD
52+
## Debugging with OpenOCD
5953

6054
I was unable to get this working with the openocd that ships with
6155
ubuntu 18.04, but was able to hook up SWD to my JLink. This thread
6256
is someone else having similar issues:
6357

6458
https://devzone.nordicsemi.com/b/blog/posts/debugging-on-nrf52840-with-gdb-from-cli-on-linux
6559

66-
## JLink
60+
## Debugging with JLink
6761

6862
I hooked up my JLink using one of these breakouts:
6963
https://www.adafruit.com/product/2743
@@ -77,6 +71,10 @@ https://www.adafruit.com/product/2743
7771
| TDO | SWO |
7872
| GND | GND x 3 |
7973

74+
* Uncomment the `arm-none-eabi-gdb` runner in .cargo/config
75+
* Start your gdbserver
76+
* use `cargo run`
77+
8078
## License
8179

8280
Licensed under either of

0 commit comments

Comments
 (0)