From b152f633be6eba5150fc21f8f5b7f1ac392f8ecf Mon Sep 17 00:00:00 2001 From: Riccardo Ripanti <35630802+Rimpampa@users.noreply.github.com> Date: Tue, 14 Feb 2023 09:07:38 +0100 Subject: [PATCH] Fix `espflash::write_bin` The problem with `write_bin` is that `board_info`, that was used instead of `print_board_info`, tries to open a new connection to the serial port and because a connection is made at the start of `write_bin`, when `board_info` gets called, it fails because the port is already being used --- espflash/src/bin/espflash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/espflash/src/bin/espflash.rs b/espflash/src/bin/espflash.rs index 584bb9a9..78b250ae 100644 --- a/espflash/src/bin/espflash.rs +++ b/espflash/src/bin/espflash.rs @@ -226,7 +226,7 @@ fn save_image(args: SaveImageArgs) -> Result<()> { fn write_bin(args: WriteBinArgs, config: &Config) -> Result<()> { let mut flasher = connect(&args.connect_args, config)?; - board_info(&args.connect_args, config)?; + print_board_info(&mut flasher)?; let mut f = File::open(&args.bin_file).into_diagnostic()?; let size = f.metadata().into_diagnostic()?.len();