summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-04-28 12:25:05 +1000
committerDamien George <damien@micropython.org>2025-05-09 12:01:50 +1000
commit928466d74c10c09570e63030419804889f8e0e98 (patch)
tree6cc3b5867d14652a09b07270d47c0611e3adf19a
parentd00eab4a3056ebaf47a1d2fdf8c21d132c465055 (diff)
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 <damien@micropython.org>
-rw-r--r--ports/rp2/Makefile3
-rw-r--r--ports/rp2/README.md6
2 files changed, 7 insertions, 2 deletions
diff --git a/ports/rp2/Makefile b/ports/rp2/Makefile
index 76b5698d2..2895faaca 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 911d797fe..41fca97f9 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.