|
| 1 | +# RP2350 MCU Flashing Methods |
| 2 | + |
| 3 | +There are three main ways to flash firmware onto an RP2350 microcontroller, each with different prerequisites and use cases. |
| 4 | +You can either flash it using the RP2350-built-in bootloader by dragging & dropping the `.uf2` file to the mounted drive, by using the [picotool](https://github.com/raspberrypi/picotool/) tool to talk to the bootloader directly, or by using a hardware debugger or second Pico for programming and debugging over an Serial-Wire-Debug (SWD) connection. The methods are detailed below. |
| 5 | + |
| 6 | +Depending on your preference, you will then learn how to install the tools for these methods in the next chapter. We recommend trying Method 1 first, as it is the easiest to use and doesn't require any installation and setup the other methods later if you need to. |
| 7 | + |
| 8 | +## Method 1: Online Conversion |
| 9 | + |
| 10 | +This method requires no software installation and works entirely through a web browser and your system's file manager. |
| 11 | + |
| 12 | +**Prerequisites:** None |
| 13 | + |
| 14 | +**Steps:** |
| 15 | +1. Take your `.elf` file |
| 16 | +2. Go to [elf2uf2.yrust.de](https://elf2uf2.yrust.de/)[^1] |
| 17 | +3. Upload and convert to `.uf2` |
| 18 | +4. Put RP2350 into boot mode: |
| 19 | + - Hold **BOOTSEL** button |
| 20 | + - Power on |
| 21 | + - Release **BOOTSEL** |
| 22 | +5. Drag & drop the `.uf2` file to the mounted drive |
| 23 | +6. Device will automatically reset and run |
| 24 | + |
| 25 | +## Method 2: Bootloader and picotool |
| 26 | + |
| 27 | +This method uses the official Raspberry Pi tool for direct flashing. |
| 28 | + |
| 29 | +**Prerequisites:** [picotool](https://github.com/raspberrypi/picotool/) installed |
| 30 | + |
| 31 | +**Steps:** |
| 32 | +1. Put RP2350 into boot mode: |
| 33 | + - Hold **BOOTSEL** button |
| 34 | + - Power on |
| 35 | + - Release **BOOTSEL** |
| 36 | +2. Flash directly with picotool: |
| 37 | + ```bash |
| 38 | + picotool load -u -v -x -t elf your_file.elf |
| 39 | + ``` |
| 40 | +3. Device will automatically reset and run |
| 41 | + |
| 42 | +## Method 3: Debug Probe |
| 43 | + |
| 44 | +This method uses a hardware debugger or second Pico for programming and debugging. |
| 45 | + |
| 46 | +**Prerequisites:** Debugger or second Pico + [probe-rs](https://probe.rs/) installed |
| 47 | + |
| 48 | +**Steps:** |
| 49 | +1. Connect debugger or second Pico to target RP2350 |
| 50 | +2. Flash and run with probe-rs: |
| 51 | + ```bash |
| 52 | + probe-rs run --chip RP235x --protocol swd your_file.elf |
| 53 | + ``` |
| 54 | +3. Device will be programmed and start running automatically |
| 55 | + |
| 56 | +## Additional Notes |
| 57 | + |
| 58 | +To erase the flash, you can use `picotool erase` or drag & drop the flash nuke utility: [flash_nuke.uf2](https://datasheets.raspberrypi.com/soft/flash_nuke.uf2) (direct download, 96 kB) |
| 59 | + |
| 60 | +[^1]: Our online tool [elf2uf2.yrust.de](https://elf2uf2.yrust.de/) simply executes `picotool uf2 convert your_file.elf your_file.uf2` - it's equivalent to having picotool installed locally but runs in the browser. |
0 commit comments