From e18284d60b5da90346c91a1e9f6de0b270da7cd4 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Fri, 4 Oct 2024 17:34:31 +0100 Subject: [PATCH] Turn on --allow-erase-all by default. It causes no harm, and avoids issues when you don't set it. --- exercise-book/src/nrf52-tools.md | 4 +--- nrf52-code/hal-app/.cargo/config.toml | 2 +- nrf52-code/radio-app/.cargo/config.toml | 2 +- nrf52-code/usb-app-solutions/.cargo/config.toml | 2 +- nrf52-code/usb-app/.cargo/config.toml | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/exercise-book/src/nrf52-tools.md b/exercise-book/src/nrf52-tools.md index 6edbfd94..0aafa1e7 100644 --- a/exercise-book/src/nrf52-tools.md +++ b/exercise-book/src/nrf52-tools.md @@ -186,7 +186,5 @@ Bus 002 Device 015: ID 1366:1051 <- J-Link on the nRF52840 Development Kit ✅ In the terminal run the following command from the [`nrf52-code/radio-app`](../../nrf52-code/radio-app) folder. This will build and run a simple program on the DK to test the set-up. ```console -cargo run --bin hello -- --allow-erase-all +cargo run --bin hello ``` - -The `-- --allow-erase-all` option gives the `--allow-erase-all` argument to `probe-rs`, which gives it permission to clear out the pre-installed Nordic bootloader code. You only need that the first time you try and program the nRF52840-DK with `cargo run`. diff --git a/nrf52-code/hal-app/.cargo/config.toml b/nrf52-code/hal-app/.cargo/config.toml index bbe3663d..75a7d205 100644 --- a/nrf52-code/hal-app/.cargo/config.toml +++ b/nrf52-code/hal-app/.cargo/config.toml @@ -1,7 +1,7 @@ [target.thumbv7em-none-eabihf] # set custom cargo runner to flash & run on embedded target when we call `cargo run` # for more information, check out https://github.com/probe-rs -runner = "probe-rs run --chip nRF52840_xxAA" +runner = "probe-rs run --chip nRF52840_xxAA --allow-erase-all" rustflags = [ "-C", "link-arg=-Tlink.x", # use the cortex-m-rt linker script "-C", "linker=flip-link", # adds stack overflow protection diff --git a/nrf52-code/radio-app/.cargo/config.toml b/nrf52-code/radio-app/.cargo/config.toml index bbe3663d..75a7d205 100644 --- a/nrf52-code/radio-app/.cargo/config.toml +++ b/nrf52-code/radio-app/.cargo/config.toml @@ -1,7 +1,7 @@ [target.thumbv7em-none-eabihf] # set custom cargo runner to flash & run on embedded target when we call `cargo run` # for more information, check out https://github.com/probe-rs -runner = "probe-rs run --chip nRF52840_xxAA" +runner = "probe-rs run --chip nRF52840_xxAA --allow-erase-all" rustflags = [ "-C", "link-arg=-Tlink.x", # use the cortex-m-rt linker script "-C", "linker=flip-link", # adds stack overflow protection diff --git a/nrf52-code/usb-app-solutions/.cargo/config.toml b/nrf52-code/usb-app-solutions/.cargo/config.toml index bbe3663d..75a7d205 100644 --- a/nrf52-code/usb-app-solutions/.cargo/config.toml +++ b/nrf52-code/usb-app-solutions/.cargo/config.toml @@ -1,7 +1,7 @@ [target.thumbv7em-none-eabihf] # set custom cargo runner to flash & run on embedded target when we call `cargo run` # for more information, check out https://github.com/probe-rs -runner = "probe-rs run --chip nRF52840_xxAA" +runner = "probe-rs run --chip nRF52840_xxAA --allow-erase-all" rustflags = [ "-C", "link-arg=-Tlink.x", # use the cortex-m-rt linker script "-C", "linker=flip-link", # adds stack overflow protection diff --git a/nrf52-code/usb-app/.cargo/config.toml b/nrf52-code/usb-app/.cargo/config.toml index bbe3663d..75a7d205 100644 --- a/nrf52-code/usb-app/.cargo/config.toml +++ b/nrf52-code/usb-app/.cargo/config.toml @@ -1,7 +1,7 @@ [target.thumbv7em-none-eabihf] # set custom cargo runner to flash & run on embedded target when we call `cargo run` # for more information, check out https://github.com/probe-rs -runner = "probe-rs run --chip nRF52840_xxAA" +runner = "probe-rs run --chip nRF52840_xxAA --allow-erase-all" rustflags = [ "-C", "link-arg=-Tlink.x", # use the cortex-m-rt linker script "-C", "linker=flip-link", # adds stack overflow protection