Most development boards can be flashed through their own USB port: a Raspberry Pi Pico shows up as a drive, a Teensy has a bootloader chip, an STM32 has a ROM loader that speaks DFU, and a Microchip Curiosity Nano carries a debugger that appears as a drive. On a desk, a person plugs the board into a computer and runs the vendor's tool or drags a file onto a drive. In a test rig, there is no person and often no computer next to the board.
A BenchPod takes the computer's place. Its USB port can act as a full-speed USB host for the board under test, and usb_flash runs the board's loader protocol from there. This article covers how that works: the setup, how the pod chooses a loader, how it writes to a drive-style loader, and what we measured. USB flashing shipped in firmware 4.0.3 on 2026-11-23. It is one of several ways the pod flashes chips, listed in How the BenchPod flashes microcontrollers.
The setup
The pod's USB port becomes a USB host (usb_host) for as long as a flash or test needs it, and the board plugs into it:
- Digital v3r4 and later have a USB-A host port. The board plugs in with its own cable and the pod powers it from its 5 V.
- Older pods (digital v3r3) use the pod's own USB-C connector through a USB-C breakout: D+, D- and GND go to the board, and the board's VBUS comes from the pod's 5 V target power.
While the pod hosts a board it is off the computer's USB, so you drive it over the LAN or the cloud. The pod is full speed (12 Mbit/s) and takes one board at a time, with no hub. The file is staged in the pod's memory first, so a flash works the same over the LAN and the cloud. The USB docs page has the full port, wiring and test tables.
Which loader: the device and the file decide
bp.usb_flash(file) in the SDK (and benchpod usb-flash <file> in the CLI, and the same call in the MCP server) needs no mode argument. The pod reads the descriptors of the device that enumerated and picks the loader together with the file type:
| What enumerated | Mode |
|---|---|
| Teensy HalfKay (16C0:0478) | teensy |
| A DFU interface (the STM32 ROM loader, a Black Pill) | dfu, at the address in the .hex or .dfu file, else 0x08000000 |
| A USB drive (Pico, Adafruit and tinyuf2 boards, DAPLink, micro:bit, the ST-LINK on NUCLEO boards, a Microchip Curiosity Nano) | uf2 for a .uf2 file, else file: the file is copied onto the drive with an 8.3 name |
| An Arduino or Adafruit AVR board, or a USB-serial chip, with a non-ESP file | avr (AVR109 or STK500) |
| An Arduino, Adafruit or Seeed SAMD board | samd (SAM-BA) |
| An Espressif chip, or a USB-serial chip with an ESP image | esp |
A Pico or Pico 2 in BOOTSEL with a .bin or .hex file | picoboot: erase, write, read back, boot |
A .hex or .dfu file is converted to a binary with its start address first. With verify=True the pod reads a drive back after the write: FAIL.TXT on a DAPLink, a compare against CURRENT.UF2 on a UF2 loader.
How a drive-style loader is written
For a board that shows up as a drive, the pod is a USB mass-storage host that writes a file the way an operating system does:
- It reads the boot sector to learn the geometry and the FAT type.
- It allocates free clusters and writes the FAT chain.
- It writes the directory entry: the 8.3 name, the size and the first cluster.
- It writes the data sectors, in order.
The order matters on debugger drives. The Curiosity Nano's on-board debugger streams a file's data straight into the target as it arrives. Microchip's documentation says Intel hex "must be parsed in strictly sequential order", and the debugger only does it for a file the directory already names. So the metadata goes first and the data after it, in sequence, which is what an operating system's copy produces too.
A UF2 loader such as the Pico's works differently. A UF2 file is a series of 512-byte blocks, and each block says which target address its payload belongs to. The loader does not care where on the drive the blocks land or in what order, so the pod writes UF2 blocks directly.
One thing to know on Microchip boards: pymcuprog makeuf2 writes Microchip's own UF2 variant, with different magic numbers from the UF2 specification. Use the .hex file on a Curiosity Nano.
What we measured
On real boards:
- Raspberry Pi Pico, UF2: 369 blocks in 2.45 s, about 77 KB/s. The drive leaves and the Pico reboots into the new program. The details are in Flashing a Raspberry Pi Pico over USB.
- Teensy 4.1, HalfKay: a 4,256-byte image in 0.3 s. See Flashing a Teensy 4.1 over USB.
- ATtiny1607 Curiosity Nano, debugger drive: a 418-byte hex file copied in about 0.2 s; the debugger programs the chip and starts it. Drive programming of Curiosity Nanos ships in firmware 4.0.6.
The PIC16F18446, PIC18F57Q43 and AVR128DA48 Curiosity Nanos use the same debugger, so the same path should work; we have not bench-tested those yet.
The chart shows the throughput ceilings of each mode on the pod's test device, which writes to RAM: file, uf2 and teensy about 145 KB/s, esp 65 KB/s, samd 50 KB/s, avr 6 KB/s and STM32 ROM DfuSe 10 KB/s. A real board is often slower, because its loader sets the pace.
Other boards have their own articles: an Arduino Uno over optiboot, an STM32H753 through its ROM DFU loader and an ESP32 through its ROM bootloader. The USB docs page lists every board and what is tested.
Using it
From Python, with the pytest package:
from embeddedci.benchpod import BenchPod
with BenchPod("192.168.1.50") as bp:
bp.usb_flash("firmware.uf2") # picks uf2 for a Pico in BOOTSEL
bp.usb_flash("blink.hex", verify=True) # a Curiosity Nano drive, read backFrom the command line:
benchpod usb-flash firmware.uf2
benchpod usb-flash app.hex --verifyFrom an AI agent, the MCP server has the same usb_flash tool. The CLI turns host mode on, flashes and says so; --port, --name, --address, --no-leave and --timeout are there for the cases that need them.
Where USB flashing fits
USB flashing goes through the development board's bootloader or its on-board debugger. That is what a Pico, a Teensy, a NUCLEO or a Curiosity Nano have, and it is the easy way to put firmware on them. A production board usually has neither: its chip is flashed over SWD or JTAG, or through its programming pins, which the pod does with its pin programmers. Some development boards have no drive or bootloader on USB either, for example the MSP430 LaunchPad with its eZ-FET and the ATtiny104 Xplained Nano with its mEDBG. Those are flashed through their programming pins: see Programming the MSP430FR2433 over Spy-Bi-Wire and Programming the ATtiny104 over TPI.
Every chip and method we have verified on real hardware is in How the BenchPod flashes microcontrollers.