Getting Started with ESP32 ESP-IDF (part 2)

In Part 1 of Getting Started with ESP32 ESP-IDF, we set up VirtualBox and successfully created a virtual machine that runs Ubuntu 14.04 LTS. In this part, we prepare the Ubuntu OS and make it into an ESP32 Development Environment to be able to compile projects for the ESP32.

Prepare Ubuntu for ESP32 development

Now that you have installed Ubuntu on your virtual machine, you are ready to start installing relevant packages that can get you started with the ESP32 development work.

Here are the steps you should be following:

  • Head over to Software & Updates in System Settings and check all the options as shown in the screenshot. Reload the cache when asked to.
  • Update Ubuntu now by opening the command terminal (ctrl+alt+T) and type command:
    sudo apt-get update
    Let the process complete. Restart if required.
  • Start installing required packages:
    sudo apt-get install git
    sudo apt-get install wget
    sudo apt-get install make
    sudo apt-get install libncurses-dev
    sudo apt-get install flex
    sudo apt-get install bison
    sudo apt-get install gperf
    sudo apt-get install python
    sudo apt-get install python-serial

    Many of these packages may already be pre-installed. Now your Ubuntu is armed with all software resources to start installing the ESP32 toolchain.

Download the toolchain

Download the compressed toolchain package from Espressif server:

Save the tar.gz file to your desktop.

Follow these steps to install the toolchain:

    • Create a folder esp32 in home/
      This folder will contain the toolchain for the ESP32.
    • Open the command terminal and switch to esp32 directory:
      cd ~/esp32
    • Extract the xtensa toolchain tar.gz archive contents into esp32 by the command:
      tar -xzf ~/Desktop/xtensa-esp32-elf-linux32-1.22.0-59.tar.gz
      This will extract and place the toolchain into ~/esp32/xtensa-esp32-elf
    • Now add the toolchain path to the environment (permanently) by editing the bashrc file:
      sudo gedit ~/.bashrc
      Now add
      export PATH=$PATH:$HOME/esp32/xtensa-esp32-elf/bin

      to the end of the bashrc file (as shown here):

    • Save changes to the bashrc file. Now open a new terminal window and type the command
      echo $PATH
      You should see the xtensa-esp32-elf/bin path in the output as shown here:

Verify toolchain installation!

Whew! That has been a long run! Now is the time to verify that everything is installed and working fine.
To check if the toolchain was properly installed, close all terminal windows and open a fresh terminal using ctrl+alt+T and use this command:

xtensa-esp32-elf-gcc -v

This should print the version information of components for you as shown here:

If you see this output, congratulations! Your toolchain is now installed and ready to use.

If you get a response like
xtensa-esp32-elf-gcc: Command not found
Then you have probably missed a step or done something wrong, sorry!
You may have to follow the procedure again…

Compiling the ESP32 blinking LED example

Now that the ESP32 toolchain is installed, we have an ESP32 Development Environment completely set up. It should now be possible to compile projects and generate BIN files to run on the ESP32.

The process of compiling a sample project for the ESP32 is covered in the next part, Part 3 of this series.

If you have something to talk about, feel free to leave your comments below! Also, scroll to the bottom of the page and SUBSCRIBE to stay updated with more awesome articles!


7 thoughts on “Getting Started with ESP32 ESP-IDF (part 2)”

  1. Pingback:Nano32 - New ESP32 Development Board to be launched

  2. Pingback:ESP32 Demo Board from Espressif Systems - first impressions!

  3. Your comment : ” If you get a response like
    xtensa-esp32-elf-gcc: Command not found
    Then you have probably missed a step or done something wrong, sorry!
    You may have to follow the procedure again…” … assumes a 32Bit Ubuntu, in contrast for a 64 Bit OS it is arrogant 😉

  4. Seems like current version of ESP-IDF requires the current version of their toolchain. Compiling with your linked toolchain, I get the errror:

    WARNING: Toolchain version is not supported: 1.22.0-59-g8d95cad
    Expected to see version: 1.22.0-73-ge28a011

    followed by other errors, including ‘missing braces around initializer’ when trying to compile the bootloader.

    I’d suggest instead of hard-coding the download link in your ‘Download ESP32 Toolchain’ button, you instead link to the Espressif webpage for setup of Linux toolchain ( ), which is more likely to be in sync with the latest ESP-IDF.

    Note this will also allow the user to select the appropriate 32-bit or 64-bit version for their linux distro.

Leave a Reply

Your email address will not be published.

one × 5 =