Skip to content

Commit acfe655

Browse files
committed
feat(test_runner): improve the error message on connection failure
The test runner asks the user to put their Pico into BOOTSEL mode on connection failure. `program_and_run_by_picoboot` is not an appropriate place to do so because it can be called between successive test runs, so the user might not have a chance to follow the given instruction.
1 parent e2f1330 commit acfe655

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/r3_test_runner/src/targets/rp_pico.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ impl Target for RaspberryPiPico {
8888
None
8989
}
9090
(Err(e1), Err(e2)) => anyhow::bail!(
91-
"Could not connect to any of a test driver \
92-
serial interface and a PICOBOOT USB interface. \n\
91+
"Could not connect to a test driver serial interface \
92+
nor a PICOBOOT USB interface. Please put your Pico into \
93+
BOOTSEL mode before executing this command.\n\
9394
\n\
9495
Serial interface error: {}\n\n\
9596
PICOBOOT interface error: {}",
@@ -233,10 +234,7 @@ async fn program_and_run_by_picoboot(exe: &std::path::Path) -> Result<()> {
233234
mut device_handle,
234235
out_endpoint_i,
235236
in_endpoint_i,
236-
} = picoboot_interface.with_context(|| {
237-
"Failed to locate the PICOBOOT interface. \
238-
Make sure to place your Pico into BOOTSEL mode before executing this command."
239-
})?;
237+
} = picoboot_interface.with_context(|| "Failed to locate the PICOBOOT interface.")?;
240238
let loadable_code = loadable_code.with_context(|| "Failed to analyze the ELF file.")?;
241239

242240
log::debug!("Transfering the image");

0 commit comments

Comments
 (0)