Update runner docs (#49)

* Update cargo-embed instructions

* Add probe-rs-cli run instructions

* Add commented probe-rs-cli runner
This commit is contained in:
9names 2023-03-15 22:11:58 +11:00 committed by GitHub
parent 9261c1216d
commit cabbe167a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 13 deletions

View File

@ -1,9 +1,11 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# Choose a default "cargo run" tool:
# - probe-run provides flashing and defmt via a hardware debugger
# - probe-run provides flashing and defmt via a hardware debugger, and stack unwind on panic
# - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode
# - "probe-rs-cli run" is similar to probe-run but it uses the latest probe-rs lib crate
runner = "probe-run --chip RP2040"
# runner = "elf2uf2-rs -d"
# runner = "probe-rs-cli run --chip RP2040 --protocol swd"
rustflags = [
"-C", "linker=flip-link",

View File

@ -134,23 +134,15 @@ Some of the options for your `runner` are listed below:
$ cargo install cargo-embed
```
*Step 2* - Make sure your .cargo/config contains the following
```toml
[target.thumbv6m-none-eabi]
runner = "cargo embed"
```
*Step 3* - Update settings in [Embed.toml](./Embed.toml)
*Step 2* - Update settings in [Embed.toml](./Embed.toml)
- The defaults are to flash, reset, and start a defmt logging session
You can find all the settings and their meanings [in the cargo-embed repo](https://github.com/probe-rs/probe-rs/blob/master/cargo-embed/src/config/default.toml)
*Step 4* - Use `cargo run`, which will compile the code and start the
specified 'runner'. As the 'runner' is cargo embed, it will flash the device
and start running immediately
*Step 3* - Use the command `cargo embed`, which will compile the code, flash the device
and start running the configuration specified in Embed.toml
```console
$ cargo run --release
$ cargo embed --release
```
* **probe-rs-debugger**
@ -171,6 +163,28 @@ Some of the options for your `runner` are listed below:
*Step 5* - Launch a debug session by choosing `Run`>`Start Debugging` (or press F5)
* **probe-rs-cli**
*Step 1* - Install [`probe-rs-cli`](https://crates.io/crates/probe-rs-cli):
```console
$ cargo install probe-rs-cli
```
*Step 2* - Make sure your .cargo/config contains the following
```toml
[target.thumbv6m-none-eabi]
runner = "probe-rs-cli run --chip RP2040 --protocol swd"
```
*Step 3* - Use `cargo run`, which will compile the code and start the
specified 'runner'. As the 'runner' is cargo embed, it will flash the device
and start running immediately
```console
$ cargo run --release
```
* **Loading a UF2 over USB**
*Step 1* - Install [`elf2uf2-rs`](https://github.com/JoNil/elf2uf2-rs):