Advanced Options

The following advanced configuration options can be used for all esptool commands (they are placed before the command name on the command line).

For basic/fundamental configuration options, see the Basic Options page.

Reset Modes

By default, esptool tries to hard reset the chip into bootloader mode before it starts and hard resets the chip to run the normal program once it is complete. The --before and --after options allow this behavior to be changed:

Reset Before Operation

The --before argument allows you to specify whether the chip needs resetting into bootloader mode before esptool talks to it.

  • --before default_reset is the default, which uses DTR & RTS serial control lines (see Entering the Bootloader) to try to reset the chip into bootloader mode.

  • --before no_reset will skip DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip. This is useful if your chip doesn’t have DTR/RTS, or for some serial interfaces (like Arduino board onboard serial) which behave differently when DTR/RTS are toggled.

  • --before no_reset_no_sync will skip DTR/RTS control signal assignments and skip also the serial synchronization command. This is useful if your chip is already running the stub bootloader and you want to avoid resetting the chip and uploading the stub again.

Reset After Operation

The --after argument allows you to specify whether the chip should be reset after the esptool operation completes:

  • --after hard_reset is the default. The DTR serial control line is used to reset the chip into a normal boot sequence.

  • --after soft_reset This runs the user firmware, but any subsequent reset will return to the serial bootloader. This was the reset behaviour in esptool v1.x.

  • --after no_reset leaves the chip in the serial bootloader, no reset is performed.

  • --after no_reset_stub leaves the chip in the stub bootloader, no reset is performed.

Disabling the Stub Loader

The --no-stub option disables uploading of a software “stub loader” that manages flash operations, and only talks directly to the loader in ROM.

Passing --no-stub will disable certain options, as not all options are implemented in every chip’s ROM loader.

Specifying Arguments via File

Anywhere on the esptool command line, you can specify a file name as @filename.txt to read one or more arguments from text file filename.txt. Arguments can be separated by newlines or spaces, quotes can be used to enclose arguments that span multiple words. Arguments read from the text file are expanded exactly as if they had appeared in that order on the esptool command line.

An example of this is available in the merge_bin command description.

Note

PowerShell users

Because of splatting in PowerShell (method of passing a collection of parameter values to a command as a unit) there is a need to add quotes around @filename.txt (“@filename.txt”) to be correctly resolved.