Build Toolchain for ESP8266

Initiating developing on ESP8266 requires a toolchain capable of cross compiling for the target. Click here for a target agnostic guide to building a cross compiler toolchain.

Following the tutorial located at which provides a seamless script to automate the whole process.

Get the dependencies:

sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf \
    flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
    sed git unzip bash help2man wget bzip2

Clone the ESP Open SDK Git repo:

git clone --recursive
cd esp-open-sdk

Use STANDALONE=y option to build a complete toolchain with required libraries placed in installation folder. Such a toolchain is easier to use. License issues are not relevant as I do not plan to distribute this toolchain.


We are done!


Do not forget to set XTENSA_TOOLS_ROOT and SDK_BASE variable in project Makefile to point to your toolchain installation directory and Espressif SDK directory respectively.

License related information is located at the end of tutorial. It is relevant for your peace of mind and conscience.


  1. AoA,
    i am trying to setup ESP_RTOS_SDK for nodeMCU by using above mentioned steps but failed. kindly help me for this.

    i am using:
    2-virtual box(Ubuntu 16.04)

  2. When execute make STANDALONE=y, I get error like this:
    WARNING! This sample may enable experimental features.
    Please be sure to review the configuration prior
    to building and using your toolchain!
    Now, you have been warned!
    Now configured for “xtensa-lx106-elf”
    make[2]: Leaving directory `/mnt/Share/esp-open-sdk/crosstool-NG’
    sed -r s%CT_PREFIX_DIR=.*%CT_PREFIX_DIR=”/home/esp8266/Share/esp-open-sdk/xtensa-lx106-elf”% .config
    sed -r -i s%CT_INSTALL_DIR_RO=y%”#”CT_INSTALL_DIR_RO=y% .config
    cat ../crosstool-config-overrides >> .config
    ./ct-ng build
    make[2]: Entering directory `/mnt/Share/esp-open-sdk/crosstool-NG’
    [INFO ] Performing some trivial sanity checks
    [ERROR] Your file system in ‘/mnt/Share/esp-open-sdk/crosstool-NG/.build’ is *not* case-sensitive!
    [ERROR] >>
    [ERROR] >> Build failed in step ‘(top-level)’
    [ERROR] >>
    [ERROR] >> Error happened in: CT_Abort[scripts/functions@331]
    [ERROR] >> called from: CT_TestAndAbort[scripts/functions@351]
    [ERROR] >> called from: main[scripts/]
    [ERROR] >>
    [ERROR] >> For more info on this error, look at the file: ‘build.log’
    [ERROR] >> There is a list of known issues, some with workarounds, in:
    [ERROR] >> ‘share/doc/crosstool-ng/crosstool-ng-1.22.0-60-g37b07f6/B – Known issues.txt’
    [ERROR] (elapsed: 25357729:40.07)
    [00:03] / make[2]: *** [build] Error 1
    make[2]: Leaving directory `/mnt/Share/esp-open-sdk/crosstool-NG’
    make[1]: *** [_toolchain] Error 2
    make[1]: Leaving directory `/mnt/Share/esp-open-sdk/crosstool-NG’
    make: *** [/home/esp8266/Share/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc] Error 2


    How to resolve this problem? Thank You.

    1. I put the ‘esp-open-sdk’ folder to ‘/home/esp8266/Share/’ folder. My problem is solved by move ‘esp-open-sdk’ folder to ‘/home/esp8266/’ folder.

Leave a Reply

Your email address will not be published. Required fields are marked *