esptool1
Esp8266 and esp32 rom bootloader utility
Overview
usage: esptool [OPTION] COMMAND
command arguments:
- Run esptool {command}
-hfor additional help
- load_ram
-
Download an image to RAM and execute
- dump_mem
-
Dump arbitrary memory to disk
- read_mem
-
Read arbitrary memory location
- write_mem
-
Read-modify-write to arbitrary memory location
- write_flash
-
Write a binary blob to flash
- run
-
Run application code in flash
- image_info
-
Dump headers from a binary file (bootloader or application)
- make_image
-
Create an application image from binary files
- elf2image
-
Create an application image from ELF file
- read_mac
-
Read MAC address from OTP ROM
- chip_id
-
Read Chip ID from OTP ROM
- flash_id
-
Read SPI flash manufacturer and device ID
- read_flash_status
-
Read SPI flash status register
- write_flash_status
-
Write SPI flash status register
- read_flash
-
Read SPI flash content
- verify_flash
-
Verify a binary blob against flash
- erase_flash
-
Perform Chip Erase on SPI flash
- erase_region
-
Erase a region of the flash
- merge_bin
-
Merge multiple raw binary files into a single file for later flashing
- get_security_info
-
Get some security-related data
- version
-
Print esptool version
options:
-
-h, --help -
show this help message and exit
-
--chip {auto,CHIP} -
Target chip type
-
--port PORT, -p PORT -
Serial port device
-
--baud BAUD, -b BAUD -
Serial port baud rate used when flashing/reading
-
--before {default_reset,usb_reset,no_reset,no_reset_no_sync} -
What to do before connecting to the chip
-
--after, -a {hard_reset,soft_reset,no_reset,no_reset_stub} -
What to do after esptool is finished
-
--no-stub -
Disable launching the flasher stub, only talk to ROM bootloader. Some features will not be available.
-
--trace, -t -
Enable trace-level output of esptool interactions.
-
--override-vddsdio -
Override ESP32 VDDSDIO internal voltage regulator (use with care)
-
--connect-attempts CONNECT_ATTEMPTS -
Number of attempts to connect, negative or 0 for infinite. Default: 7.
Examples
Display device features, SPI flash manufacturer and device ID:
-
esptool flash_id
Flash ESP8266 Espressif AT v1.6.2 firmware to ESP-WROOM-02 board:
-
esptool write_flash --flash_mode dio --flash_size 4MB-c1 0x00 boot_v1.7.bin 0x1000 at/1024+1024/user1.2048.new.5.bin 0xfe000 blank.bin 0x3fc000 esp_init_data_default_v08.bin 0x3fe000 blank.bin
Flash ESP32 Espressif AT v1.1.1 firmware to ESP-WROOM-32 board:
-
esptool write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader/bootloader.bin 0x20000 at_customize.bin 0x21000 customized_partitions/ble_data.bin 0x24000 customized_partitions/server_cert.bin 0x26000 customized_partitions/server_key.bin 0x28000 customized_partitions/server_ca.bin 0x2a000 customized_partitions/client_cert.bin 0x2c000 customized_partitions/client_key.bin 0x2e000 customized_partitions/client_ca.bin 0xf000 phy_init_data.bin 0x100000 esp-at.bin 0x8000 partitions_at.bin
Display ESP32 efuse state summary:
-
espefuse --port /dev/ttyUSB0 summary
Generate a flash encryption key:
-
espsecure generate_flash_encryption_key key.bin
Burn the key to the device (WARNING: one time only operation):
-
espefuse --port /dev/ttyUSB1 burn_key flash_encryption key.bin
Encrypt flash data:
-
espsecure encrypt_flash_data --keyfile key.bin --address 0x10000 -o my-app-encrypted.bin my-app.bin
Releases
4 releases since Debian 9 (Stretch); the text changed 3 times.
--after since Debian 10 (Buster);
--baud since Debian 10 (Buster);
--before since Debian 10 (Buster);
--chip since Debian 10 (Buster);
--connect-attempts since Debian 13 (Trixie);
--no-stub since Debian 10 (Buster);
--override-vddsdio since Debian 10 (Buster);
--port since Debian 10 (Buster);
--trace since Debian 10 (Buster);
-a since Debian 10 (Buster);
-b since Debian 10 (Buster);
-h since Debian 10 (Buster);
-p since Debian 10 (Buster);
-t since Debian 10 (Buster).
--version until Debian 9 (Stretch);
-bc until Debian 9 (Stretch);
-bf until Debian 9 (Stretch);
-bm until Debian 9 (Stretch);
-bo until Debian 9 (Stretch);
-bs until Debian 9 (Stretch);
-bz until Debian 9 (Stretch);
-c until Debian 11 (Bullseye);
-ca until Debian 9 (Stretch);
-cb until Debian 9 (Stretch);
-cc until Debian 9 (Stretch);
-cd until Debian 9 (Stretch);
-cf until Debian 9 (Stretch);
-cp until Debian 9 (Stretch);
-ec until Debian 9 (Stretch);
-eo until Debian 9 (Stretch);
-q until Debian 9 (Stretch);
-v until Debian 9 (Stretch).