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

Add option to verify written flash #353

Merged
merged 4 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- [#345] Update dev-dependency `serial_test`
- [#344] Replace `pub(crate)` with `pub`
- [#343] Mark `v0.3.4` as released in `CHANGELOG.md`
- [#353] add option to verify written flash

[#349]: https://github.com/knurling-rs/probe-run/pull/349
[#345]: https://github.com/knurling-rs/probe-run/pull/345
Expand Down
6 changes: 5 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Opts {
elf: Option<PathBuf>,

/// Skip writing the application binary to flash.
#[structopt(long, conflicts_with = "defmt")]
#[structopt(long, conflicts_with = "disable-double-buffering", conflicts_with = "verify")]
pub no_flash: bool,

/// Connect to device when NRST is pressed.
Expand Down Expand Up @@ -82,6 +82,10 @@ pub struct Opts {
#[structopt(long = "disable-double-buffering")]
pub disable_double_buffering: bool,

/// Verifies the written program.
#[structopt(long)]
pub verify: bool,
Urhengulas marked this conversation as resolved.
Show resolved Hide resolved

/// Arguments passed after the ELF file path are discarded
#[structopt(name = "REST")]
_rest: Vec<String>,
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ fn run_target_program(elf_path: &Path, chip_name: &str, opts: &cli::Opts) -> any
options.dry_run = false;
options.progress = Some(&fp);
options.disable_double_buffering = opts.disable_double_buffering;
options.verify = opts.verify;

flashing::download_file_with_options(&mut sess, elf_path, Format::Elf, options)?;
log::info!("success!");
Expand Down