RASPBERRY PI PICO / PICO W / PICO 2 REFERENCE
HARDWARE REF v1.0

VARIANTS

MODELCHIPFLASHRAMWIFI/BTUSBNOTES
PicoRP20402MB264KB SRAMNoneUSB 1.1 FSOriginal — castellated edges
Pico HRP20402MB264KB SRAMNoneUSB 1.1 FSPre-soldered headers + debug connector
Pico WRP20402MB264KB SRAMWiFi 802.11n · BT 5.2USB 1.1 FSCYW43439 radio
Pico WHRP20402MB264KB SRAMWiFi · BTUSB 1.1 FSPico W with headers
Pico 2RP2350A4MB520KB SRAMNoneUSB 1.1 FSDual Cortex-M33 + RISC-V, 2× faster
Pico 2 WRP2350A4MB520KB SRAMWiFi · BT 5.2USB 1.1 FSLatest — 2024

PINOUT — RP2040 / RP2350 (40-pin)

GP0 · UART0 TX · SPI0 RX · I2C0 SDA · PWM0A
GP1 · UART0 RX · SPI0 CSn · I2C0 SCL · PWM0B
GND
GP2 · SPI0 SCK · I2C1 SDA · PWM1A
GP3 · SPI0 TX · I2C1 SCL · PWM1B
GP4 · UART1 TX · SPI0 RX · I2C0 SDA · PWM2A
GP5 · UART1 RX · SPI0 CSn · I2C0 SCL · PWM2B
GND
GP6 · SPI0 SCK · I2C1 SDA · PWM3A
GP7 · SPI0 TX · I2C1 SCL · PWM3B
GP8 · UART1 TX · SPI1 RX · I2C0 SDA · PWM4A
GP9 · UART1 RX · SPI1 CSn · I2C0 SCL · PWM4B
GND
GP10 · SPI1 SCK · I2C1 SDA · PWM5A
GP11 · SPI1 TX · I2C1 SCL · PWM5B
GP12 · UART0 TX · SPI1 RX · I2C0 SDA · PWM6A
GP13 · UART0 RX · SPI1 CSn · I2C0 SCL · PWM6B
GND
GP14 · SPI1 SCK · I2C1 SDA · PWM7A
GP15 · SPI1 TX · I2C1 SCL · PWM7B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
VBUS (5V from USB)
VSYS (2-5V supply)
GND
3V3_EN (pull low to disable 3.3V)
3V3 OUT (300mA max)
ADC_VREF (ADC reference voltage)
GP26 · ADC0 · I2C1 SDA
GND (AGND)
GP27 · ADC1 · I2C1 SCL
GP28 · ADC2 · SPI1 RX
RUN / RESET (pull low to reset)
GP22 · PWM3A
GND
GP21 · I2C0 SCL · PWM2B
GP20 · I2C0 SDA · PWM2A · UART1 TX
GP19 · SPI0 TX · I2C1 SCL · PWM1B
GP18 · SPI0 SCK · I2C1 SDA · PWM1A
GND
GP17 · SPI0 CSn · I2C0 SCL · PWM0B
GP16 · SPI0 RX · I2C0 SDA · PWM0A · UART0 TX
GPIO (digital I/O + alternate funcs)   ADC (12-bit, 0–3.3V)   3.3V power   VSYS/VBUS   GND   System pins

FLASHING — .UF2 METHOD (easiest)

BOOTSEL / DFU MODE
Enters mass storage mode — no driver needed
  1. Hold the BOOTSEL button
  2. Connect USB to PC (or plug in while holding)
  3. Release BOOTSEL — drive appears as RPI-RP2 (or RP2350)
  4. Drag and drop the .uf2 file onto the drive
  5. Drive disappears — board reboots into new firmware automatically
Works on Windows, Linux, macOS, Android with OTG cable. No esptool, no drivers, no serial config required.
PICOTOOL (advanced)
CLI tool for flash, info, reboot
# Install (requires libusb)
pip install picotool
# or build from source: github.com/raspberrypi/picotool

# Flash while in BOOTSEL mode:
picotool load firmware.uf2
picotool reboot

# Info about connected Pico:
picotool info

# Reboot into BOOTSEL from running firmware
# (if firmware supports USB_RESET_TO_BOOTLOADER)
picotool reboot -f -u
CIRCUITPYTHON ON PICO
Download from circuitpython.org/board/raspberry_pi_pico
  1. Download adafruit-circuitpython-raspberry_pi_pico-*.uf2
  2. Enter BOOTSEL mode
  3. Drop .uf2 onto RPI-RP2 drive
  4. Board reboots as CIRCUITPY USB drive
  5. Edit code.py directly in any text editor
Also install Mu editor or use Thonny for REPL access.
MICROPYTHON ON PICO
Download from micropython.org/download/RPI_PICO
  1. Download rp2-pico-*.uf2 (or rp2-pico-w for Pico W)
  2. Enter BOOTSEL mode
  3. Drop .uf2 onto RPI-RP2 drive
  4. Connect Thonny or any terminal at 115200 baud
  5. REPL prompt >>> appears
# Thonny: Tools > Options > Interpreter > MicroPython (Pico)
# Or raw terminal:
screen /dev/ttyACM0 115200 # Linux
putty COM? 115200 # Windows

BADUSB / HID PAYLOADS

PICO-DUCKY (DuckyScript)
github.com/dbisu/pico-ducky
  1. Flash CircuitPython onto Pico
  2. Download pico-ducky release zip
  3. Copy duckyinpython.pycode.py on CIRCUITPY
  4. Install adafruit_hid library to lib/
  5. Write payload to payload.dd in DuckyScript format
  6. Reconnect — payload runs automatically
Hold GP0 to ground on boot to disable payload (safe mode). GP0 is the default — configurable in code.
WIFI DUCK (Pico W)
github.com/SpacehuhnTech/WiFiDuck
  1. Download WiFi Duck Pico W .uf2
  2. Flash via BOOTSEL method
  3. Pico W creates WiFi AP: WiFiDuck (pw: wifiduck)
  4. Connect phone/laptop to AP
  5. Open 192.168.4.1 in browser
  6. Write and run DuckyScript payloads via web UI
Pico W acts as USB HID to target while also serving web UI over WiFi. No USB connection to attacker device needed during execution.
CIRCUITPYTHON HID (custom)
Full control via Python
# code.py example
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import time

kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)

time.sleep(2) # wait for host
kbd.send(Keycode.GUI, Keycode.R)
time.sleep(0.5)
layout.write("cmd\n")
time.sleep(1)
layout.write("whoami\n")
KEYBOARD LAYOUTS
Critical — match target OS keyboard setting
LAYOUT LIBTARGET
keyboard_layout_usUS QWERTY (default)
keyboard_layout_win_ukWindows UK
keyboard_layout_deGerman QWERTZ
keyboard_layout_frFrench AZERTY
UK layout shifts @ and " — use keyboard_layout_win_uk or payloads will mistype on UK targets.

MICROPYTHON QUICK REFERENCE

GPIO

from machine import Pin
led = Pin(25, Pin.OUT) # onboard LED
led.on()
led.toggle()
btn = Pin(15, Pin.IN, Pin.PULL_UP)
print(btn.value()) # 0 when pressed

UART

from machine import UART
uart = UART(0, baudrate=115200,
tx=Pin(0), rx=Pin(1))
uart.write(b'hello\r\n')
if uart.any():
print(uart.read())

ADC

from machine import ADC
adc = ADC(26) # GP26 = ADC0
# 16-bit value 0–65535
val = adc.read_u16()
volts = val * 3.3 / 65535

I2C

from machine import I2C, Pin
i2c = I2C(0, sda=Pin(4), scl=Pin(5))
devices = i2c.scan() # list addresses
i2c.writeto(0x68, bytes([0x6B, 0]))
data = i2c.readfrom(0x68, 6)

SPI

from machine import SPI, Pin
spi = SPI(0, baudrate=1_000_000,
sck=Pin(2), mosi=Pin(3), miso=Pin(4))
cs = Pin(5, Pin.OUT)
cs.low()
spi.write(b'\x00\x01')
cs.high()

PICO W WIFI

import network, time
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('SSID', 'password')
while not wlan.isconnected():
time.sleep(0.5)
print(wlan.ifconfig())

DEBUGGING

SWD / PICOPROBE DEBUG
Hardware debugging with a second Pico

Flash a second Pico with picoprobe.uf2 (download from raspberrypi.com). Wire SWCLK, SWDIO, GND to target Pico debug pins. Use with OpenOCD + GDB or the VS Code Raspberry Pi Pico extension.

PROBE PINTARGET PIN
GP2 (SWCLK)SWCLK (pin 24)
GP3 (SWDIO)SWDIO (pin 25)
GNDGND
GP4 (UART TX)GP1 (UART0 RX)
GP5 (UART RX)GP0 (UART0 TX)
COMMON ISSUES
PROBLEMFIX
RPI-RP2 not appearingHold BOOTSEL before connecting USB — not after
Drive appears but .uf2 copy failsUse File > Copy, not drag-drop, on some Windows
CIRCUITPY not showingWait 10s after flash — first boot is slow
Thonny can't connectClose other serial terminals first — only one app can own COM port
HID not workingCheck boot.py — HID must be enabled, usb_cdc may conflict
Payload mistypesWrong keyboard layout — match target OS/locale
HYLAS SECURITY // PICOREF v1.0INTERNAL — HARDWARE REFERENCE