Skip to content

Commit 06f43e7

Browse files
committed
Add Zadig message to failed RP2040 forced reboots
Also encourage -f/F on Windows, rather than a separate reboot
1 parent 783f75d commit 06f43e7

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
@@ -8729,6 +8729,11 @@ int main(int argc, char **argv) {
87298729
bool had_note = false;
87308730
fos << missing_device_string(tries>0, selected_cmd->requires_rp2350());
87318731
if (tries) {
8732+
#if defined(_WIN32)
8733+
if (settings.force_rp2040) {
8734+
fos << " You may need to install a driver via Zadig. See \"Getting started with Raspberry Pi Pico\" for more information.";
8735+
}
8736+
#endif
87328737
fos << " It is possible the device is not responding, and will have to be manually entered into BOOTSEL mode.\n";
87338738
had_note = true; // suppress "but:" in this case
87348739
}
@@ -8760,13 +8765,8 @@ int main(int argc, char **argv) {
87608765
printer(dr_vidpid_micropython,
87618766
" appears to be an RP-series MicroPython device not in BOOTSEL mode.");
87628767
if (selected_cmd->force_requires_pre_reboot()) {
8763-
#if defined(_WIN32)
8764-
printer(dr_vidpid_stdio_usb,
8765-
" appears to have a USB serial connection, not in BOOTSEL mode. You can force reboot into BOOTSEL mode via 'picotool reboot -f -u' first.");
8766-
#else
87678768
printer(dr_vidpid_stdio_usb,
87688769
" appears to have a USB serial connection, so consider -f (or -F) to force reboot in order to run the command.");
8769-
#endif
87708770
} else {
87718771
// special case message for what is actually just reboot (the only command that doesn't require reboot first)
87728772
printer(dr_vidpid_stdio_usb,
@@ -8813,6 +8813,7 @@ int main(int argc, char **argv) {
88138813
libusb_get_device_descriptor(to_reboot, &desc);
88148814
if (desc.idProduct == PRODUCT_ID_RP2040_STDIO_USB || settings.force_rp2040) {
88158815
disable_mask = 0; // enable MSC interface so Zadig works correctly
8816+
settings.force_rp2040 = true;
88168817
}
88178818
}
88188819
#endif

0 commit comments

Comments
 (0)