The ports/espressif build setup is a rather involved process. Please read the README.md in that directory. It has instructions that also refer to further instructions in the ESP-IDF documentation.

Start with the setup described on the Build CircuitPython page.

On MacOS, you will need to install cmake and ninja:

brew install cmake
brew install ninja

On Linux you probably need to install ninja-build and cmake.

sudo apt install ninja-build cmake

The ESP-IDF expects there to be a python command which runs python3. On Ubuntu, there is no plain python by default, so install this simple package which links python to python3.

sudo apt install python-is-python3

Once you have the prerequisites installed, change to the ports/espressif directory, and run the install.sh script. You only need to do this once.

cd circuitpython/ports/espressif
esp-idf/install.sh

After this, in each fresh terminal window in which you are doing builds, you need to use esp-idf/export.sh in order to set up the correct PATH and other environment variables.

# Do this in each new terminal.
cd circuitpython/ports/espressif
source esp-idf/export.sh

export.sh will suggest that you use idf.py to do a build after you run it. But we don't use idf.py. Instead, use make, for example:

make BOARD=adafruit_magtag_2.9_grayscale

You will need to repeat the pip3 install commands described here so that they take effect inside the Python environment set up by source esp-idf/export.sh. But you will need to do this only once.

This guide was first published on Apr 26, 2018. It was last updated on Mar 31, 2024.

This page (Espressif Builds) was last updated on Mar 25, 2024.

Text editor powered by tinymce.