Supported boards and protocols
nanoflash flashes these chips natively and in the browser. Each protocol is one backend and, in the
browser, one WebAssembly module (the three AVR protocols share the avr module).
Summary
Protocol (protocol =) | Chips (chip =) | Boards | Verify | Images |
|---|---|---|---|---|
espressif | esp32, esp32-s2, esp32-s3, esp32-c2, esp32-c3, esp32-c5, esp32-c6, esp32-h2, esp32-p4 | Any board with an Espressif chip, through its ROM loader | MD5 | Binary, Intel HEX, ELF (application image) |
samba | nrf52840 | Arduino Nano 33 BLE | CRC-16 (Z) | Binary, Intel HEX, ELF |
samba | samd21g18a, samd21j18a, samd21e18a | Arduino SAMD21 boards, such as the MKR WiFi 1010 | CRC-16 (Z) | Binary, Intel HEX, ELF |
stk500v1 (alias arduino) | atmega328p | Arduino Uno, Nano, Pro Mini (Optiboot, ATmegaBOOT) | Read-back | Binary, Intel HEX, ELF |
stk500v2 (alias wiring) | atmega2560 | Arduino Mega 2560 (the wiring bootloader) | Read-back | Binary, Intel HEX, ELF |
avr109 | atmega32u4 | Arduino Leonardo, Micro, Pro Micro (Caterina) | Read-back | Binary, Intel HEX, ELF |
The browser package reads binary and Intel HEX images only: its WebAssembly modules do not have
the elf feature. The ESP8266 is not supported. USB DFU, UF2, CMSIS-DAP (in the command only) and Nordic serial DFU are planned.
Espressif
- The board resets into its ROM loader through DTR and RTS (
espressif-classic, through a UART bridge) or through the USB-Serial-JTAG peripheral (espressif-usb-serial-jtag, USB identity303a:1001). - The default baud rate is 460800 through a UART bridge. USB-Serial-JTAG and the ESP32-C2 stay at 115200 baud. When the caller asks for another rate on one of them, the flash goes on at 115200 baud and nanoflash reports a note with the reason. The USB-Serial-JTAG peripheral has no baud rate. The ESP32-C2 ROM loader computes its rates for a 40 MHz crystal, which many boards replace with a 26 MHz one. A request for 115200 baud gives no note.
- Writes are compressed, except on the ESP32. No flasher stub is used: the ROM supports compressed writes and MD5.
- In secure download mode, the ROM refuses
SPI_FLASH_MD5, so what was written is not read back (not-verified-in-secure-download-mode). - An ELF image goes to a
firmwareorupdatepartition at a multiple of0x10000. The command turns it into an application image withespflash4.7. The library and the browser package refuse ELF images on Espressif. - With a
detectlayout, build the bootloader for the flash size or with flash size detection.
SAM-BA (Arduino Nano 33 BLE, SAMD21)
- A 1200-baud touch on the port of the sketch starts the bootloader, which appears as another USB
device. The Nano 33 BLE goes from
2341:805ato2341:005a. nanoflash waits up to 15 s for it. - nanoflash writes and checks the images with CRC-16, then resets into the application.
- The bootloader at the start of flash is never written.
writable_fromis0x10000on the Nano 33 BLE and0x2000on the SAMD21 boards. - The SAMD21 bootloader erases more than it writes. What
flasherases describes it. --baud-rateis ignored.
AVR (Arduino Uno, Nano, Mega 2560, Leonardo)
- Arduino’s AVR boards take the
.hexfile that the Arduino IDE builds. - STK500v1 (Uno, Nano, Pro Mini): a pulse on DTR resets the board into Optiboot or the older ATmegaBOOT. nanoflash tries 115200 baud, then 57600 (the old Nano bootloader).
- STK500v2 (Mega 2560): the same pulse resets the board into the wiring bootloader, at 115200
baud only. It never erases above
0x3BFFF, so the application ends at0x3C000, and its erase order limits the order of the images (Whatflasherases). - AVR109 (Leonardo, Micro, Pro Micro): a 1200-baud touch starts Caterina, which shows up on its
own port (
2341:8036becomes2341:0036on a Leonardo). Caterina goes back to the sketch 8 s after the touch, so nanoflash waits 7 s for it natively and 5 s in the browser.--baud-rateis ignored. - Pages are written whole and read back to check them. The bootloader at the top of the flash is
never written:
writable_tois0x7E00on an Uno with Optiboot. - The bootloaders have no usable chip erase, so “erased” means “programmed with
0xFF”.
USB identities that detect knows
Without --protocol, detect picks the protocol from the USB identity of the port:
| USB identity | Protocol |
|---|---|
Uno: 2341:0043, 2341:0001, 2a03:0043, 2341:0243, 2341:006a and kin | stk500v1 |
Mega 2560: 2341:0010, 2341:0042 and their 2a03 and 02xx variants | stk500v2 |
Leonardo, Micro and other ATmega32U4 boards: 2341:8036, 2341:0036 and kin, with Adafruit’s and SparkFun’s | avr109 |
Any other product of vendor 0x2341 | samba |
Vendor 0x303a | espressif |
A Nano or a Pro Mini behind a serial bridge (FTDI, CH340) has no known identity: pass
--protocol, or a board manifest whose board lists no devices.