RP2: Support jump to bootloader command.

* Add picotool binary.
* Support jump to bootloader command.
* MSC interface is disabled on jump to boot.
This commit is contained in:
iabdalkader 2021-07-06 20:42:57 +02:00
parent 9f8db9b745
commit a076fc79b8
4 changed files with 18 additions and 0 deletions

View File

@ -86,6 +86,12 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR;
// USB IRQn.
#define OMV_USB_IRQN (USBCTRL_IRQ_IRQn)
// Jump to bootloader function.
#ifndef LINKER_SCRIPT
void pico_reset_to_bootloader(void);
#endif
#define MICROPY_RESET_TO_BOOTLOADER pico_reset_to_bootloader
// Linker script constants (see the linker script template port/x.ld.S).
#define OMV_FB_MEMORY RAM // Framebuffer, fb_alloc
#define OMV_MAIN_MEMORY RAM // data, bss and heap memory

View File

@ -86,6 +86,12 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR;
// USB IRQn.
#define OMV_USB_IRQN (USBCTRL_IRQ_IRQn)
// Jump to bootloader function.
#ifndef LINKER_SCRIPT
void pico_reset_to_bootloader(void);
#endif
#define MICROPY_RESET_TO_BOOTLOADER pico_reset_to_bootloader
// Linker script constants (see the linker script template port/x.ld.S).
#define OMV_FB_MEMORY RAM // Framebuffer, fb_alloc
#define OMV_MAIN_MEMORY RAM // data, bss and heap memory

View File

@ -47,6 +47,7 @@
#include "hardware/rtc.h"
#include "hardware/structs/rosc.h"
#include "pico/unique_id.h"
#include "pico/bootrom.h"
#include "omv_boardconfig.h"
#include "framebuffer.h"
@ -86,6 +87,11 @@ void __fatal_error()
}
}
void pico_reset_to_bootloader(void)
{
reset_usb_boot(0, 1);
}
void exec_boot_script(const char *path, bool interruptible)
{
nlr_buf_t nlr;

BIN
tools/picotool Executable file

Binary file not shown.