Installation ESP8266 toolchain Fedora 26

Resurces:

Link to repository of software. We will make reference, to this repository

This tutorial is designed for Fedora 26, if you got Ubuntu, you should read apposite reference LINK

Installation of system packages

First of all we start installing system packages, required for compile, work with freeRTOS.

dnf install make autoconf automake libtool gcc gperf flex\
            bison texinfo gawk python sed git unzip \
            bash help2man wget bzip2 \
            gcc-c++ ncurses-devel expat-devel python-devel pyserial
dnf install unar

Install of ESP-Open-SDK

Note:Make must be executed by unprivileged user. The installation could take more then 20 minutes.

If you execute make with root user, you must frist `make clean` and chown -R /opt/esp-open-sdk

# Change on tmp, folder for downlaod
cd /tmp

# Download with --recursive because we need also subrepository
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git /opt/esp-open-sdk/

# move downloaded folder into /opt/ folder
sudo chown -R user:user /opt/esp-open-sdk/

cd /opt/esp-open-rtos

# Start compile toolchain
make toolchain esptool libhal STANDALONE=n

# then make other time
make
# Search this line in then output of make, then paste it in your .bashrc.
export PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

# EXAMPLE OUTPUT
user@fedora:$ >make
Makefile:180: warning: overriding recipe for target 'ESP8266_NONOS_SDK_V1.5.4_16_05_20/.dir'
Makefile:169: warning: ignoring old recipe for target 'ESP8266_NONOS_SDK_V1.5.4_16_05_20/.dir'
cp esptool/esptool.py /opt/esp-open-sdk/xtensa-lx106-elf/bin/
ln -snf ESP8266_NONOS_SDK_V1.5.4_16_05_20 sdk
Installing vendor SDK headers into toolchain sysroot
Installing vendor SDK libs into toolchain sysroot
Installing vendor SDK linker scripts into toolchain sysroot
make -C esp-open-lwip -f Makefile.open install \
    CC=/opt/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc \
    AR=/opt/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar \
    PREFIX=/opt/esp-open-sdk/xtensa-lx106-elf
make[1]: Entering directory '/opt/esp-open-sdk/esp-open-lwip'
cp liblwip_open.a /opt/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/
make[1]: Leaving directory '/opt/esp-open-sdk/esp-open-lwip'
cp -a esp-open-lwip/include/arch esp-open-lwip/include/lwip esp-open-lwip/include/netif \
    esp-open-lwip/include/lwipopts.h \
    /opt/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/

Xtensa toolchain is built, to use it:

|export PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH| THIS LINE
^________________________________________________________^
Espressif ESP8266 SDK is installed, its libraries and headers are merged with the toolchain

# END

cd $HOME
vim .bashrc

# .bashrc
[.....]
export PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
source .bashrc

 

Installation of esptool

cd /tmp
wget https://github.com/themadinventor/esptool
# move downloaded file in /usr/local/bin
sudo mv -v esptool /usr/local/bin/

Installation of FreeRTOS for ESP8266

cd /tmp
git clone --recursive https://github.com/Superhouse/esp-open-rtos.git
sudo mv -v /tmp/esp-open-sdk /opt/
sudo chown -Rv user:user /opt/esp-open-rtos/
cd /opt/esp-open-rtos/
vim include/ssid_config.h

# include/ssid_config.h

# Comment this line //#error
# Then add correct SSID and Password

//#error "You need to enter your wifi credentials in this file and follow the instructions here to keep the password safe from Github commits."

#ifndef __SSID_CONFIG_H__
#define __SSID_CONFIG_H__

#define WIFI_SSID "Wi-Fi2"
#define WIFI_PASS "medionsamsug"

[...]

Test

We can test ouas installation by using FreeRTOS example, contained in FreeRTOS repository.

# Add ouars user to group DialOUT
sudo usermod -a -G dialout $USER
# So, you must logout for reload group, or Reboot system
sudo systemctl reboot


# Try Build example
cd /opt/esp-open-rtos/examples/http_get
make
# if all compile correct then ouars configuration is correct

# For compile and flash ESP8266
make flash
# For compile flash and start serial console
make test

For flash chip `make flash`, for flash and start serial console `make test`