Standard Setup of Toolchain for Linux — ESP8266 RTOS SDK Programming Guide documentation (original) (raw)
Install Prerequisites¶
To compile with ESP8266_RTOS_SDK you need to get the following packages:
- CentOS 7:
sudo yum install gcc git wget make ncurses-devel flex bison gperf python pyserial - Ubuntu and Debian:
sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python python-serial - Arch:
sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial
Toolchain Setup¶
ESP8266 toolchain for Linux is available for download from Espressif website:
- for 64-bit Linux:
https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz - for 32-bit Linux:
https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz
- Download this file, then extract it in
~/espdirectory:
mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz - The toolchain will be extracted into
~/esp/xtensa-lx106-elf/directory.
To use it, you will need to update yourPATHenvironment variable in~/.profilefile. To makextensa-lx106-elfavailable for all terminal sessions, add the following line to your~/.profilefile:
export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"
Alternatively, you may create an alias for the above command. This way you can get the toolchain only when you need it. To do this, add different line to your~/.profilefile:
alias get_lx106='export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"'
Then when you need the toolchain you can typeget_lx106on the command line and the toolchain will be added to yourPATH.
Note
If you have/bin/bashset as login shell, and both.bash_profileand.profileexist, then update.bash_profileinstead. - Log off and log in back to make the
.profilechanges effective. Run the following command to verify ifPATHis correctly set:
You are looking for similar result containing toolchain’s path at the end of displayed string:
$ printenv PATH
/home/user-name/bin:/home/user-name/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user-name/esp/xtense-lx106-elf/bin
Instead of/home/user-namethere should be a home path specific to your installation.
Permission issues /dev/ttyUSB0¶
With some Linux distributions you may get the Failed to open port /dev/ttyUSB0 error message when flashing the ESP8266.
If this happens you may need to add your current user to the correct group (commonly “dialout”) which has the appropriate permissions:
sudo usermod -a -G dialout $USER
In addition, you can also use “sudo chmod” to set permissions on the “/dev/ttyUSB0” file before running the make command to resolve:
sudo chmod -R 777 /dev/ttyUSB0
Next Steps¶
To carry on with development environment setup, proceed to section Get ESP8266_RTOS_SDK.