From 928466d74c10c09570e63030419804889f8e0e98 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 28 Apr 2025 12:25:05 +1000 Subject: [PATCH] rp2/Makefile: Add deploy target that uses picotool load. This is a convenient way to deploy firmware to an RP2xxx-based board. Signed-off-by: Damien George --- ports/rp2/Makefile | 3 +++ ports/rp2/README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/rp2/Makefile b/ports/rp2/Makefile index 76b5698d2c..2895faaca6 100644 --- a/ports/rp2/Makefile +++ b/ports/rp2/Makefile @@ -67,6 +67,9 @@ all: clean: $(RM) -rf $(BUILD) +deploy: all + $(Q)picotool load -x $(BUILD)/firmware.elf + # First ensure that pico-sdk is initialised, then run CMake with the # UPDATE_SUBMODULES flag to update necessary submodules for this board. # diff --git a/ports/rp2/README.md b/ports/rp2/README.md index 911d797fe0..41fca97f95 100644 --- a/ports/rp2/README.md +++ b/ports/rp2/README.md @@ -47,8 +47,10 @@ pass the board name to the build; e.g. for Raspberry Pi Pico W: ## Deploying firmware to the device Firmware can be deployed to the device by putting it into bootloader mode -(hold down BOOTSEL while powering on or resetting) and then copying -`firmware.uf2` to the USB mass storage device that appears. +(hold down BOOTSEL while powering on or resetting) and then either copying +`firmware.uf2` to the USB mass storage device that appears, or using +`picotool load -x firmware.elf`. The latter command can be accessed +conveniently via `make deploy`. If MicroPython is already installed then the bootloader can be entered by executing `import machine; machine.bootloader()` at the REPL.