arduino-pico/cores/rp2040/RP2040Support.cpp
Earle F. Philhower, III 083d86d251
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
2024-11-14 10:46:53 -08:00

37 lines
1.2 KiB
C++

/*
RP2040 utility class
Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef PICO_RP2040
#include <Arduino.h>
#include <hardware/structs/psm.h>
extern "C" void boot_double_tap_check();
// The following check will never actually execute, but it will cause the boot reset
// checker to be linked in as part of the constructors.
void RP2040::enableDoubleResetBootloader() {
if (psm_hw->done == 0) {
boot_double_tap_check();
}
}
#endif