ESP8266 RTOS SDK

Last Updated on 11 September 2021 by Suffocation

The RTOS SDK is Espressif's proprietary programming environment for the ESP8266.

Facts

The Arduino SDK also encapsulates the functionalities of this SDK. Now one might ask why write specialised code for the ESP8266 by using the SDK directly. The answer isn't entirely simple but here are a few arguments:

  • The framework offers advanced functionalities which are not encapsulated in the Arduino IDE.
  • There are existing IoT programmes based on the framework.
  • It was always more up-to-date than the Arduino IDE in the past (it's no longer being developed).
  • Errors will be eliminated here first.
  • The Espressif AT Framework is based on it

Requirements

  • Sufficient hard drive space > 2GB
  • Working Python environment
  • Knowledge of the Windows Console (CMD)

Areas of application

  • AT-Firmware
  • Embedded programming
  • Usage of the RTOS's own OS functions

Installation

Windows

The current version is not working properly for me!!!

Install toolchain

IMPORTANT Do not use paths with spaces, this only leads to problems.

https://docs.espressif.com/projects/esp8266-rtos-sdk/en/v3.4/get-started/windows-setup.html

To install the utilities (toolchain), download the complete package at:

https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20181001.zip

I am unzipping the package to C:/Devel

Install RTOS Framework

Now the programming framework is also needed, this provides git:

git clone -b v3.4 --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git

Set IDF path. I'm doing this manually because I also have the IDF for the ESP32 installed.

set IDF_PATH=C:\Devel\ESP8266_RTOS_SDK

Install Python packages

pip install --user -r $IDF_PATH/requirements.txt

That should be it for now, and if no errors occur during programming later, it will have worked completely ;). It's currently still flagging up a few sources that I can't resolve. There's also the option to perform the installation in the MINGW environment, which annoyed me because of the limited console. That's why I decided to install the framework on a Raspberry Pi. This went without any major complications, as you'll see in the following chapter.

Linux (on PI)

Create directory esp under user PI:

cd ~/
mkdir ./esp
cd esp

This directory is where everything happens.

Install necessary packages

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python python-serial
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
For the PI
https://https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-armel.tar.gz

Install toolchain

Download the toolchain using:

wget https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz

Unpacking toolchain:

tar -xzf ./xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz  

Open the file `~/.profile` in your chosen editor and add the following line at the end. (Only if it should also be present again after restarting the console)

export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"" 

Either log out and back in, or simply run the line again on the console.

RTOS Framework

This can be fetched with Git, release v2.2.0.0 is the last to support the ESP8266.

git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git

add the path to the ~/.profile file as well (only if it should also be available again after restarting the console)

Set IDF_PATH export IDF_PATH="$HOME/esp/ESP8266_RTOS_SDK""

Install Python module

python -m pip install --user -r $IDF_PATH/requirements.txt

If pip is missing

sudo apt-get install python-pip

Add the Python program directory to the path:

export PATH="$PATH:/home/pi/.local/bin""

Programming

Copy and compile the example program:

cp -r $IDF_PATH/examples/get-started/hello_world 
cd hello_world
make menuconfig
make  
make flash

Configure all settings with menuconfig; for me, there were exactly 0 settings. Create the binary file with make and write the file to the ESP with flash. Unfortunately, flashing, which is easily possible under Windows, did not work with the ESP8266 module used.

Problems

The information on the Espressif site is incorrect

The information on the Espressif page should be used with caution. Some information is no longer correct, while other information is not suitable for a Windows environment. The information is also not very version-stable, so always pay attention to the version.

Miscellaneous

No.

Conclusion

Windows doesn't seem to be supported, or at least it's a nightmare to get the environment up and running here. On Linux, it works quickly and easily, and the documentation fits better too.

Related Posts

Sources

https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz

https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz

https://https://dl.espressif.com/dl/xtensa-lx106-elf-gcc8_4_0-esp-2020r3-linux-armel.tar.gz

https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/get-started-devkitc.html

https://git-scm.com/downloads

https://docs.espressif.com/projects/esp8266-rtos-sdk/en/v3.4/get-started/windows-setup.html

Leave a Reply

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