diff --git a/README.md b/README.md index 303f3248..59771b3d 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,17 @@ Add this line to your Cargo configuration (`.cargo/config`) file: ``` toml [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip $CHIP" +runner = "probe-run --chip ${PROBE_RUN_CHIP}" ``` -Instead of `$CHIP` you'll need to write the name of your microcontroller. +Instead of `${PROBE_RUN_CHIP}` you can write the name of your microcontroller. For example, one would use `nRF52840_xxAA` for the nRF52840 microcontroller. To list all supported chips run `probe-run --list-chips`. +To support multiple devices, or permit overriding default behavior, you may prefer to set the +`${PROBE_RUN_CHIP}` environment variable, and set `runner` (or +`CARGO_TARGET_${TARGET_ARCH}_RUNNER`) to `probe-run`. + 2. Enable debug info Next check that debug info is enabled for all profiles. diff --git a/src/main.rs b/src/main.rs index 1247673e..30c2c33d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,7 +51,7 @@ struct Opts { defmt: bool, /// The chip to program. - #[structopt(long, required_unless("list-chips"))] + #[structopt(long, required_unless("list-chips"), env = "PROBE_RUN_CHIP")] chip: Option, /// Path to an ELF firmware file.