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

Allow environment variables to set chip arguments. #41

Merged
merged 2 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

/// Path to an ELF firmware file.
Expand Down