Install ESP SDK and Toolchain - mriksman/esp-idf-homekit GitHub Wiki
ESP-IDF Build System
ESP-IDF beginning with v4.0 uses CMake by default and plans to phase out support of GNU Make by v5.0.
Build Systems
CMake is a build system generator whilst GNU Make and Ninja are build systems. CMake can be used to generate the build system files for a number of different build systems, so it can be used platform independent.
Install Required Programs
There are multiple ways to configure the system;
The installer includes the cross-compilers, OpenOCD, CMake and Ninja build tool. The installer can also download and run installers for Python 3.7 and Git For Windows if they are not already installed on the computer.
- Use the idf_tools.py install command to install the ESP-IDF Tools.
- Install Git For Windows
- Install Python 3.x
- Get ESP-IDF
git clone \--recursive https://github.com/espressif/esp-idf.git
- Run idf_tools.py install.
- This will install CMake, OpenOCD, Ninja and the xtensa-esp32-elf Toolchain.
ESP8266 RTOS SDK seems to still be catching up with ESP-IDF's use of CMake and ESP-IDF Tools installation.
- Documentation still references the MSYS2(GNU compatible environment) https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/windows-setup.html
- The tools.json file (that idf_tools.py uses), doesn't list the correct xtensa-lx106-elf Toolchain, so I doubt it would work... https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/tools/tools.json
- Install manually (Preferred, and easy to do)
- Install Git For Windows
- Install Python 3.x (ESP-IDF makes a note that there may be issues with 3.x and to use 2.7)
- Install to C:\Python (some scripts might not like spaces in default pathname)
- After installation, try running a .py script, and associate with the python.exe. Otherwise, you'll get a Program 'idf.py' failed to run: Application not found At line:1 char:1 error.
- Install CMake For Windows
- When the installer asks for Install Options, select 'Add CMake to the system PATH for the current user'.
- Download Ninja
- Extract the executable file to the bin folder within CMake. As CMake is now in the PATH environment variable, you won't have to add another PATH.
- Download the Toolchain
- Download the SDK
- Open PowerShell and navigate to the esp32/esp8266 folder.
- Run
git clone --recursive https://github.com/espressif/esp-idf.git
orgit clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git
- Install the Python dependencies
pip install -r "path\to\esp32\esp-idf\requirements.txt"
The folder structure will look like this
esp32 esp8266
|-- esp-idf |-- ESP8266_RTOS_SDK
└-- xtensa-esp32-elf └-- xtensa-lx106-elf
For ESP-IDF pre 4.0 and ESP RTOS SDK v3.x, you'll need to supply a prebuilt binary called mconf-idf. Place the files in a directory listed in PATH.