Skip to content

Commit 083d86d

Browse files
rp2040.enableDoubleResetBootloader only on RP2040 (#2607)
The RP2350 boot ROM seems to randomize memory on a HW reset, including both CPU stacks where we normally stuff the "reset to bootloader" flag. Update the docs and source to remove rp2040.enableDoubleResetBootloader() on RP2350-based boards. Fixes #2606
1 parent 7a0adfe commit 083d86d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

cores/rp2040/RP2040Support.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#ifdef PICO_RP2040
22+
2123
#include <Arduino.h>
2224
#include <hardware/structs/psm.h>
2325

@@ -31,3 +33,5 @@ void RP2040::enableDoubleResetBootloader() {
3133
boot_double_tap_check();
3234
}
3335
}
36+
37+
#endif

cores/rp2040/RP2040Support.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ class RP2040 {
351351
}
352352
}
353353

354+
#ifdef PICO_RP2040
354355
static void enableDoubleResetBootloader();
356+
#endif
355357

356358
void wdt_begin(uint32_t delay_ms) {
357359
watchdog_enable(delay_ms, 1);

docs/rp2040.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ doing any WiFi calls.
9595
Bootloader
9696
----------
9797

98-
void rp2040.enableDoubleResetBootloader()
99-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98+
void rp2040.enableDoubleResetBootloader() (Pico/RP2040 only)
99+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100100
Add a call anywhere in the sketch to ``rp2040.enableDoubleResetBootloader()`` and
101101
the core will check for a double-tap on reset, and if found will start the USB
102102
bootloader.

0 commit comments

Comments
 (0)