Chapter 1. Get Started
idf.py -p PORT [-b BAUD] flash
Replace PORT with your ESP32-S2 board’s serial port name from Step 6. Connect Your Device.
You can also change the flasher baud rate by replacing BAUD with the baud rate you need. The default baud rate is
460800.
For more information on idf.py arguments, see idf.py.
Note: The option flash automatically builds and flashes the project, so running idf.py build is not necessary.
1.13.1 Encountered Issues While Flashing?
If you run the given command and see errors such as “Failed to connect”, there might be several reasons for this.
One of the reasons might be issues encountered by esptool.py, the utility that is called by the build system to
reset the chip, interact with the ROM bootloader, and flash firmware. One simple solution to try is manual reset
described below, and if it does not help you can find more details about possible issues in Troubleshooting.
esptool.py resets ESP32-S2 automatically by asserting DTR and RTS control lines of the USB to serial converter
chip, i.e., FTDI or CP210x (for more information, see Establish Serial Connection with ESP32-S2). The DTR and
RTS control lines are in turn connected to GPIO0 and CHIP_PU (EN) pins of ESP32-S2, thus changes in the voltage
levels of DTR and RTS will boot ESP32-S2 into Firmware Download mode. As an example, check the schematic
for the ESP32 DevKitC development board.
In general, you should have no problems with the official esp-idf development boards. However, esptool.py is
not able to reset your hardware automatically in the following cases:
• Your hardware does not have the DTR and RTS lines connected to GPIO0 and CHIP_PU
• The DTR and RTS lines are configured differently
• There are no such serial control lines at all
Depending on the kind of hardware you have, it may also be possible to manually put your ESP32-S2 board into
Firmware Download mode (reset).
• For development boards produced by Espressif, this information can be found in the respective getting started
guides or user guides. For example, to manually reset an esp-idf development board, hold down the Boot
button (GPIO0) and press the EN button (CHIP_PU).
• For other types of hardware, try pulling GPIO0 down.
1.13.2 Normal Operation
When flashing, you will see the output log similar to the following:
...
esptool.py --chip esp32s2 -p /dev/ttyUSB0 -b 460800 --before=default_reset --
,→after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB␣
,→0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin␣
,→0x10000 hello_world.bin
esptool.py v3.0-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-S2
Features: WiFi
Crystal is 40MHz
MAC: 18:fe:34:72:50:e3
Uploading stub...
Running stub...
Stub running...
(continues on next page)
Espressif Systems 67
Submit Document Feedback
Release v4.4