rp2040: Support CanBoot as bootloader

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2022-10-21 21:50:21 -04:00
parent 42e9adcfc9
commit 6485ff800b
3 changed files with 41 additions and 14 deletions

View File

@@ -6,6 +6,7 @@
#include <stdint.h> // uint32_t
#include "board/misc.h" // bootloader_request
#include "generic/armcm_reset.h" // try_request_canboot
#include "hardware/structs/clocks.h" // clock_hw_t
#include "hardware/structs/pll.h" // pll_hw_t
#include "hardware/structs/resets.h" // sio_hw
@@ -45,6 +46,7 @@ DECL_INIT(watchdog_init);
void
bootloader_request(void)
{
try_request_canboot();
// Use the bootrom-provided code to reset into BOOTSEL mode
reset_to_usb_boot(0, 0);
}