Flash the Device

[中文]

You can start the flash operation by clicking the launch button run_icon. The process is automatically configured to flash the application using the default command: idf.py -p PORT flash.

flash

Customize Flash Arguments

To provide the customized launch configuration and flash arguments, follow the steps below:

  1. Click on the Launch Configuration edit button.

  2. Switch to the Main tab.

  3. Specify the Location where this application has to run. Since idf.py is a Python file, configure the Python system path. Example: ${system_path:python}.

  4. Specify the Working directory of the application. Example: ${workspace_loc:/hello_world}.

  5. In the Arguments field (see 1 in the image), the default value uses dynamic variables:

    ${IDF_PY} -B ${BUILD_DIR} -p ${serial_port} ${flash_command}

    This default setup automatically adapts to your project and board, so usually no manual changes are needed.

    • Use the Preview icon (see 2 in the image) to switch between showing resolved values and the raw dynamic variables.

    • The field is modifiable only when dynamic variables are shown (not resolved).

    • If you are migrating from an older plugin version and the field does not contain dynamic variables, click Restore defaults (see 3 in the image) to reset it.

  6. Click OK to save the settings.

  7. Click on the Launch icon to flash the application to the selected board.

Launch configuration Flashing process

Flash Encryption

Warning

Enabling flash encryption is an irreversible operation. If configured incorrectly, the board may become permanently unusable. Proceed with caution and only enable this option if you fully understand its implications.

To enable flash encryption in ESP-IDF, follow these steps:

  1. Open sdkconfig and enable the Enable flash encryption on boot option.

    Flash encryption sdkconfig
  2. Perform a normal flash of the application.

  3. Open the Launch Configuration dialog, edit the configuration, and check the Enable Flash Encryption box.

    Flash encryption checkbox
  4. Flash the application again.

Once enabled, flash encryption will automatically secure the contents of the flash memory according to ESP-IDF settings.

For more details, please refer to the official Flash Encryption documentation.

Upload Application via JTAG

The default method for uploading applications is UART. To switch to JTAG, edit the launch configuration of your project and select the appropriate option.

To do so, select your project in the launch configuration bar and click on the gear icon to edit the launch configuration:

Edit launch configuration

Then select the Flash Over JTAG option and complete the OpenOCD Setup section.

Flash over JTAG option

If the Flash Over JTAG option is not available, and you see a message like this:

OpenOCD update required message

It means that OpenOCD needs to be updated. You can find the latest OpenOCD version on the openocd-esp32 GitHub page.

Providing the Right Path for OpenOCD

After downloading the necessary OpenOCD version, extract it to a new folder in the .espressif/tools/openocd-esp32/.

Follow these steps:

  1. Download the required v0.10.0-esp32-20201202 version or a higher one for JTAG flashing.

  2. Go to .../.espressif/tools/openocd-esp32/, create a new folder named v0.10.0-esp32-20201202, and extract OpenOCD there.

  3. The resulting path to OpenOCD might look like: .../.espressif/tools/openocd-esp32/v0.10.0-esp32-20201202/openocd-esp32/....

After completing this, update the OPENOCD_SCRIPT environment variable in Eclipse:

  1. Go to Eclipse > Preferences > C/C++ > Build > Environment.

  2. Edit the OPENOCD_SCRIPTS variable by providing the correct path to the openocd/scripts folder.

  3. The path to the OpenOCD scripts may look like this: .../.espressif/tools/openocd-esp32/v0.10.0-esp32-20201202/openocd-esp32/share/openocd/scripts.