Skip to content

Commit 23843f4

Browse files
committed
Add Zadig message to failed RP2040 forced reboots
Also encourage -f/F on Windows, rather than a separate reboot
1 parent 3fccd48 commit 23843f4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8650,6 +8650,11 @@ int main(int argc, char **argv) {
86508650
bool had_note = false;
86518651
fos << missing_device_string(tries>0, selected_cmd->requires_rp2350());
86528652
if (tries) {
8653+
#if defined(_WIN32)
8654+
if (settings.force_rp2040) {
8655+
fos << " You may need to install a driver via Zadig. See \"Getting started with Raspberry Pi Pico\" for more information.";
8656+
}
8657+
#endif
86538658
fos << " It is possible the device is not responding, and will have to be manually entered into BOOTSEL mode.\n";
86548659
had_note = true; // suppress "but:" in this case
86558660
}
@@ -8681,13 +8686,8 @@ int main(int argc, char **argv) {
86818686
printer(dr_vidpid_micropython,
86828687
" appears to be an RP-series MicroPython device not in BOOTSEL mode.");
86838688
if (selected_cmd->force_requires_pre_reboot()) {
8684-
#if defined(_WIN32)
8685-
printer(dr_vidpid_stdio_usb,
8686-
" appears to have a USB serial connection, not in BOOTSEL mode. You can force reboot into BOOTSEL mode via 'picotool reboot -f -u' first.");
8687-
#else
86888689
printer(dr_vidpid_stdio_usb,
86898690
" appears to have a USB serial connection, so consider -f (or -F) to force reboot in order to run the command.");
8690-
#endif
86918691
} else {
86928692
// special case message for what is actually just reboot (the only command that doesn't require reboot first)
86938693
printer(dr_vidpid_stdio_usb,
@@ -8734,6 +8734,7 @@ int main(int argc, char **argv) {
87348734
libusb_get_device_descriptor(to_reboot, &desc);
87358735
if (desc.idProduct == PRODUCT_ID_RP2040_STDIO_USB || settings.force_rp2040) {
87368736
disable_mask = 0; // enable MSC interface so Zadig works correctly
8737+
settings.force_rp2040 = true;
87378738
}
87388739
}
87398740
#endif

0 commit comments

Comments
 (0)