Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit e1964b8

Browse files
author
Jonas Schievink
authored
Merge pull request #41 from Hoverbear-Consulting/allow-env-vars
Allow environment variables to set chip arguments.
2 parents 730a24c + 51096ba commit e1964b8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ Add this line to your Cargo configuration (`.cargo/config`) file:
3333

3434
``` toml
3535
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
36-
runner = "probe-run --chip $CHIP"
36+
runner = "probe-run --chip ${PROBE_RUN_CHIP}"
3737
```
3838

39-
Instead of `$CHIP` you'll need to write the name of your microcontroller.
39+
Instead of `${PROBE_RUN_CHIP}` you can write the name of your microcontroller.
4040
For example, one would use `nRF52840_xxAA` for the nRF52840 microcontroller.
4141
To list all supported chips run `probe-run --list-chips`.
4242

43+
To support multiple devices, or permit overriding default behavior, you may prefer to set the
44+
`${PROBE_RUN_CHIP}` environment variable, and set `runner` (or
45+
`CARGO_TARGET_${TARGET_ARCH}_RUNNER`) to `probe-run`.
46+
4347
2. Enable debug info
4448

4549
Next check that debug info is enabled for all profiles.

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct Opts {
5656
defmt: bool,
5757

5858
/// The chip to program.
59-
#[structopt(long, required_unless("list-chips"))]
59+
#[structopt(long, required_unless("list-chips"), env = "PROBE_RUN_CHIP")]
6060
chip: Option<String>,
6161

6262
/// Path to an ELF firmware file.

0 commit comments

Comments
 (0)