How to flash a board with your own file
The flasher opens the board's port over Web Serial, resets the board into its bootloader and identifies it: for ESP32 and ESP8266 the chip, revision and flash size, for Arduino the chip by its signature, the bootloader and the speed. ESP boards are flashed with Espressif's esptool-js, with compression and an MD5 check. Arduino Uno, Nano and Mega go through their own bootloader over the STK500 protocol, with a read-back of what was written. The Pico gets a .uf2 file copied to its drive. The file is read in the browser and stays on your computer.
The flasher picks the address for a .bin from the file contents: full image, application or bootloader. Several .bin files selected at once go into a table, with addresses taken from the board's chip and from the partition table in the same set. You can edit an address there by hand.
Examples
- Three files from PlatformIO (bootloader.bin, partitions.bin and firmware.bin) for an ESP32 land at 0x1000, 0x8000 and 0x10000 and are written in one go. For an ESP32-C3 the bootloader from the same set goes to 0x0.
- For a .hex sketch on a Nano with a CH340, the flasher tries 115200 baud (the new Optiboot bootloader) and 57600 baud (the Old Bootloader) and writes at the speed the bootloader answered at.
Common mistakes
- People enter address 0x0 in the settings for an application file without a bootloader. The application overwrites the bootloader, and the board won't start until you write a full image to it.
- People pick a file for the wrong chip, for example an ESP32 file with an ESP32-C3 connected. The flasher reads the chip in the image header and doesn't start writing.
FAQ
- How do I put an ESP32 into flashing mode?
- Usually the board enters the bootloader on its own through the DTR and RTS signals of the USB adapter. If the flasher says "The board did not enter flashing mode", hold BOOT, press and release EN (RESET), release BOOT and click "Try again" right away. On NodeMCU and Wemos D1 mini (ESP8266) the buttons are called FLASH and RST.
- Which address should I flash a .bin to: 0x0, 0x1000 or 0x10000?
- A full image (a merged bin: bootloader, partition table and application) is written at 0x0, an application without a bootloader at 0x10000, the partition table at 0x8000. A separate bootloader goes to 0x1000 on ESP32 and S2, to 0x2000 on C5 and P4, and to 0x0 on S3, C3, C6 and H2, which is how esptool lays them out. The "Write address (ESP)" field in the settings is for your own layout.
- What if I get Failed to connect, or the port is not in the list?
- Use a cable with data lines and plug the board straight into the computer, not through a hub. If the board shows up in Device Manager without a driver, install the driver for its USB adapter: CH340 from WCH, CP2102 from Silicon Labs. Open the page in Chrome, Edge or Opera on a computer and enter the bootloader with the BOOT and EN buttons.
- Can I flash a board from a phone?
- Not from an iPhone or iPad: browsers there have neither Web Serial nor WebUSB. In a browser on Android without Web Serial the flasher opens the board over WebUSB, and that only works with CH340 and CH341 adapters connected through an OTG cable.
- How do I upload a sketch to an Arduino Nano without the Arduino IDE?
- You need a ready-made .hex file: the project author provides one, or the Arduino IDE produces it with "Sketch → Export Compiled Binary". Take the file without with_bootloader in its name. The flasher detects the Old Bootloader on its own. If the board doesn't respond, click "Try again" and press RESET right away.
- How do I flash a Raspberry Pi Pico with a .uf2 file?
- Hold BOOTSEL and, without releasing it, plug the Pico in with a cable: a drive appears, RPI-RP2 for the Pico and RP2350 for the Pico 2. In Chrome, Edge and Opera the flasher writes the file to that drive, in other browsers drag the .uf2 onto the drive yourself. If the Pico is already running Arduino or MicroPython firmware, the link "Reboot to BOOTSEL over the port" puts it into this mode.