From 5947316019c7554a34b390cf1961fc69692a4f1c Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 14 Nov 2025 13:42:41 -0800 Subject: [PATCH] Update 1200bps reset sequence for better compat Fixes #3240 Don't reset the USB peripheral, with all that entails, when rebooting from the 1200bps tickle. Instead just disconnect the port, leaving the USB HW in a sane state. Wait enough time for the host to note the disconnect, and then reboot to the ROM bootloader. --- cores/rp2040/SerialUSB.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cores/rp2040/SerialUSB.cpp b/cores/rp2040/SerialUSB.cpp index 096da6bda..fcda49db2 100644 --- a/cores/rp2040/SerialUSB.cpp +++ b/cores/rp2040/SerialUSB.cpp @@ -199,15 +199,10 @@ void SerialUSB::checkSerialReset() { __freertos_idle_other_core(); #endif _ss.rebooting = true; - // Disable NVIC IRQ, so that we don't get bothered anymore - irq_set_enabled(USBCTRL_IRQ, false); - // Reset the whole USB hardware block - reset_block(RESETS_RESET_USBCTRL_BITS); - unreset_block(RESETS_RESET_USBCTRL_BITS); - // Delay a bit, so the PC can figure out that we have disconnected. - busy_wait_ms(3); + tud_disconnect(); + busy_wait_ms(100); reset_usb_boot(0, 0); - while (1); // WDT will fire here + while (1); // WDT will fire here, we will reboot to MSD } }