From cabbe167a0e2b6725ca63bc67d17a670b1a8bfec Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:11:58 +1100 Subject: [PATCH] Update runner docs (#49) * Update cargo-embed instructions * Add probe-rs-cli run instructions * Add commented probe-rs-cli runner --- .cargo/config.toml | 4 +++- README.md | 38 ++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 079bc43..2eab29d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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", diff --git a/README.md b/README.md index d774c93..cf1d891 100644 --- a/README.md +++ b/README.md @@ -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):