RP2040 Auto Flash — VS Code ExtensionAuto-flash your Raspberry Pi Pico / RP2040 UF2 files from VS Code without pressing BOOTSEL — exactly like Arduino IDE does. How It WorksThis extension replicates the 1200bps DTR magic trick used by the Arduino-Pico core (
InstallationFrom VSIX (manual install)
From VS Code
CommandsOpen the Command Palette (
Right-click shortcutRight-click any SettingsOpen Settings (
workspace
|
| Platform | Status |
|---|---|
| Windows 10/11 | ✅ Full support |
| macOS | ✅ Full support |
| Linux (Ubuntu, Debian, Fedora) | ✅ Full support |
Linux: udev rule (avoid sudo)
Add this rule so VS Code can access serial ports without root:
echo 'SUBSYSTEM=="tty", ATTRS{idVendor}=="2e8a", MODE="0666"' | sudo tee /etc/udev/rules.d/99-rp2040.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
Workflow with Pico SDK / CMake
# Build your firmware (CMake)
cd build && cmake .. && make -j4
# The extension will find build/firmware.uf2 automatically if you set uf2Path
# Or right-click firmware.uf2 in VS Code Explorer → RP2040: Auto Flash UF2
Combine with a VS Code Task (.vscode/tasks.json)
{
"version": "2.0.0",
"tasks": [
{
"label": "Build & Flash RP2040",
"type": "shell",
"command": "cd build && make -j4",
"group": { "kind": "build", "isDefault": true },
"presentation": { "reveal": "always" },
"dependsOn": [],
"postBuild": {
"command": "rp2040-autoflash.flash"
}
}
]
}
Troubleshooting
"No serial ports found"
- Make sure your RP2040 firmware includes a USB CDC serial interface (
stdio_usb_init()in C SDK, orimport usb_cdcin CircuitPython). - On Linux, add your user to the
dialoutgroup:sudo usermod -aG dialout $USERthen log out/in.
"Could not find RPI-RP2 drive"
- Increase
bootloaderWaitMsto5000or more. - On Windows, check Device Manager — the drive should appear as a removable disk.
- Set
drivePathmanually if auto-detect fails.
Reset works but board stays in bootloader
- The UF2 file may be corrupt or built for a different board. Verify with
picotool info firmware.uf2.