- Joined
- Aug 12, 2024
- Messages
- 48
You did this?...I’ve tried, it still comes up as a faulty device.
Also for extremely detailed instructions...
Yes! Programming the RP2040 through USB is straightforward, thanks to its USB Mass Storage Mode Bootloader. Here’s how you can do it:
Steps to Program the RP2040 via USB
1. Enter Bootloader Mode
The RP2040 microcontroller has a built-in USB bootloader, allowing it to appear as a mass storage device when connected to a computer. To enter this mode:
- Hold the BOOTSEL button (or pull the BOOTSEL pin high).
- Plug in the board via USB to your computer.
- Release the BOOTSEL button after the USB connection is established.
Your RP2040 board (e.g., Raspberry Pi Pico) should now appear as a USB drive named RPI-RP2.
2. Flashing Firmware
Once the RP2040 appears as a USB drive, you can program it by copying a UF2 firmware file to it.
For MicroPython or CircuitPython:
- Download a UF2 file (e.g., MicroPython for RP2040 or CircuitPython for RP2040).
- Drag and drop the UF2 file onto the RPI-RP2 drive.
- The board will automatically reboot and start running the firmware.
For C/C++ or Rust Development:
If you're working with C/C++ (via the Pico SDK) or Rust, you'll need to:
- Compile your code into a UF2 file.
- Drag and drop the generated UF2 file onto the RPI-RP2 drive.
3. Programming via USB Serial (Without BOOTSEL)
Once firmware (like MicroPython or a custom USB stack) is flashed, you can upload new code via USB serial instead of entering BOOTSEL mode each time.
For MicroPython / CircuitPython:
- Use a serial terminal like Thonny (Python IDE) or screen / minicom on Linux to interact with the board over USB.
For Arduino IDE (With RP2040 Boards Support):
- Install Arduino-Pico core (by Earle Philhower).
- Select Raspberry Pi Pico in the Arduino IDE.
- Upload sketches directly through USB without entering BOOTSEL mode.
For C/C++ with UF2 Bootloader:
- Use picotool to upload binaries directly:
picotool load my_program.uf2<br>
4. Debugging and Advanced Flashing
For more advanced development, you can:
- Use SWD Debugging: With an external debug probe like a second RP2040 running PicoProbe.
- Use picotool for more control over firmware uploads and board information.
- Flash firmware using a USB-to-Serial adapter (for non-USB firmware).
Summary
- Hold BOOTSEL, plug in USB → Board appears as RPI-RP2.
- Drag & drop a UF2 file to program it.
- Reboot automatically and run the firmware.
- For USB serial programming, use MicroPython, CircuitPython, or Arduino IDE.
- For debugging, use picotool or SWD.
Would you like a step-by-step example with code for a specific environment (e.g., Arduino, C++, or MicroPython)?

