It seems that a large part of the ESP8266 community has moved to the esp-open-sdk toolchain. And for a reason: the esp-open-sdk is much easier to install and update. Besides that, the esp-open-sdk replaes many of the proprietary libraries with open source versions.
Just as an exercise, I decided to give this toolchain a try as well, starting with a bare Ubuntu 14.04 (server) installation as its foundation again. It was my goal to make the same blinky run, but this time through the use of the esp-open-sdk toolchain.
Please find the steps to get the toolchain installed below:
#Install needed dependencies
sudo apt-get -y install git autoconf build-essential
sudo apt-get -y install gperf bison flex texinfo libtool libncurses5-dev wget gawk libc6-dev-amd64 python-serial libexpat-dev dpkg-dev unzip
# Install the esp-open-sdk toolchain
sudo git clone https://github.com/pfalcon/esp-open-sdk.git
sudo chown -R jpenninkhof esp-open-sdk
echo 'PATH=$PATH:/opt/esp-open-sdk/xtensa-lx106-elf/bin' >> ~/.profile
echo 'PATH=$PATH:/opt/esp-open-sdk/esptool' >> ~/.profile
# Installing the ESP image tool
wget -O esptool_0.0.2-1_i386.deb https://github.com/esp8266/esp8266-wiki/raw/master/deb/esptool_0.0.2-1_i386.deb
sudo dpkg -i esptool_0.0.2-1_i386.deb
The installation of the toolchain is much easier and has less steps, but be warned that it still takes a long time to install.
Updating is simple:
git submodule update
Making the toolchain directory clean is important. If you don’t issue make clean (which causes toolchain and SDK to be rebuilt from scratch on next make), you risk getting broken/inconsistent results.
To install the blinky demo firmware, the esp8266 can be pulled. However, it assumes that the Espressif SDK is installed in the Espressif directory, as described in my previous esp8266 blog post. However, the sample should be using the open SDK instead. That’s why a few additional sed statements should be issued, changing the Espressif paths to the open SDK paths.
git clone https://github.com/esp8266/source-code-examples.git
sed -i 's/Espressif\/crosstool-NG\/builds\/xtensa-lx106-elf\/bin/esp-open-sdk\/xtensa-lx106-elf\/bin/g' Makefile
sed -i 's/Espressif\/ESP8266_SDK/esp-open-sdk\/sdk/g' Makefile
sed -i 's/Espressif/esp-open-sdk/g' Makefile
Before you can upload anything, you need to have access to the serial port to do so. The serial port device (/dev/ttyUSB0) has the group of dialout. All you need to do grant yourself access to the serial port is to add yourself to the dialout group:
sudo adduser jpenninkhof dialout
After getting access to the serial port, the sketch that has just been built can be uploaded to the ESP8266 chip. To get the board in “upload mode”, the board should be booted while GPIO0 is grounded. On the development board (right, click for larger view) this can be very easily achieved by keeping the GPIO0 pushbutton (top-leftmost button pressed, while pressing the reset-button (bottom-left-most button). Shortly after the reset-button has been released, the GPIO0 button can also be released again. The sketch can then be uploaded using:
After the upload had completed, the ESP8266 should be toggling GPIO2 again, getting the led to blink slowly.