Flash onto the Device

Flash operation can be initiated with just a click of a launch button run_icon and it’s auto-configured to flash the application with the default flash command, i.e., idf.py -p PORT flash.

flash

To provide customized flash arguments, please follow this link for further instructions.

To configure flashing via JTAG, please refer to this JTAG Flashing guide

Customize Flash Arguments

To provide the customized launch configuration and flash arguments, please follow the step-by-step instructions 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 additional arguments, provide a flashing command that will run in the specified working directory.

  6. The flash command looks like this: /Users/user-name/esp/esp-idf/tools/idf.py -p /dev/cu.SLAB_USBtoUART flash.

  7. Click OK to save the settings.

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

Launch configuration Flashing process

Upload Application via JTAG

The default option for uploading applications is UART. To change it to JTAG, you need to edit the launch configuration for 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:

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

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

  • 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:

  • Go to Eclipse > Preferences > C/C++ > Build > Environment

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

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