Skip to content

Commit

Permalink
docs: update toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Jan 11, 2017
1 parent f04e62e commit 8d2199e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
22 changes: 12 additions & 10 deletions docs/linux-setup.rst
Expand Up @@ -10,11 +10,11 @@ Install some packages
To compile with ESP-IDF you need to get the following packages:

- Ubuntu and Debian::
sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial

sudo apt-get install 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

Step 1: Download binary toolchain for the ESP32
Expand All @@ -24,17 +24,17 @@ ESP32 toolchain for Linux is available for download from Espressif website:

- for 64-bit Linux::

https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-59.tar.gz
https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz

- for 32-bit Linux::

https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-59.tar.gz
https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-61-gab8375a-5.2.0.tar.gz

This comment has been minimized.

Copy link
@wa67

wa67 Jan 30, 2017

This file doesn't exist on https://dl.espressif.com/dl !!!


Download this file, then extract it to the location you prefer, for example::

mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-59.tar.gz
tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz

The toolchain will be extracted into ``~/esp/xtensa-esp32-elf/`` directory.

Expand All @@ -61,12 +61,14 @@ To run the precompiled gdb (xtensa-esp32-elf-gdb) in Arch Linux requires ncurses
Alternative Step 1: Compile the toolchain from source using crosstool-NG
========================================================================

Instead of downloading binary toolchain from Espressif website (Step 1 above) you may build the toolchain yourself.
Instead of downloading binary toolchain from Espressif website (Step 1 above) you may build the toolchain yourself.

If you can't think of a reason why you need to build it yourself, then probably it's better to stick with the binary version. However, here are some of the reasons why you might want to compile it from source:

- if you want to customize toolchain build configuration

- if you want to use a different GCC version (such as 4.8.5)

- if you want to hack gcc or newlib or libstdc++

- if you are curious and/or have time to spare
Expand All @@ -79,7 +81,7 @@ In any case, here are the steps to compile the toolchain yourself.

- Ubuntu::

sudo apt-get install gawk gperf grep gettext ncurses python python-dev automake bison flex texinfo help2man libtool
sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool

- Debian::

Expand Down Expand Up @@ -113,7 +115,7 @@ Open terminal, navigate to the directory you want to clone ESP-IDF and clone it
git clone --recursive https://github.com/espressif/esp-idf.git


ESP-IDF will be downloaded into ``~/esp/esp-idf``.
ESP-IDF will be downloaded into ``~/esp/esp-idf``.

Note the ``--recursive`` option! If you have already cloned ESP-IDF without this option, run another command to get all the submodules::

Expand Down Expand Up @@ -142,7 +144,7 @@ In terminal, go to the application directory which was obtained on the previous

cd ~/esp/myapp

Type a command like this to set the path to ESP-IDF directory::
Type a command like this to set the path to ESP-IDF directory::

export IDF_PATH=~/esp/esp-idf

Expand Down
13 changes: 7 additions & 6 deletions docs/macos-setup.rst
Expand Up @@ -23,13 +23,13 @@ Step 1: Download binary toolchain for the ESP32

ESP32 toolchain for macOS is available for download from Espressif website:

https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-59.tar.gz
https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-61-gab8375a-5.2.0.tar.gz

Download this file, then extract it to the location you prefer, for example::

mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-esp32-elf-osx-1.22.0-59.tar.gz
tar -xzf ~/Downloads/xtensa-esp32-elf-osx-1.22.0-61-gab8375a-5.2.0.tar.gz

The toolchain will be extracted into ``~/esp/xtensa-esp32-elf/`` directory.

Expand All @@ -46,12 +46,14 @@ Then when you need the toolchain you can type ``get_esp32`` on the command line
Alternative Step 1: Compile the toolchain from source using crosstool-NG
========================================================================

Instead of downloading binary toolchain from Espressif website (Step 1 above) you may build the toolchain yourself.
Instead of downloading binary toolchain from Espressif website (Step 1 above) you may build the toolchain yourself.

If you can't think of a reason why you need to build it yourself, then probably it's better to stick with the binary version. However, here are some of the reasons why you might want to compile it from source:

- if you want to customize toolchain build configuration

- if you want to use a different GCC version (such as 4.8.5)

- if you want to hack gcc or newlib or libstdc++

- if you are curious and/or have time to spare
Expand Down Expand Up @@ -107,7 +109,7 @@ Open Terminal.app, navigate to the directory you want to clone ESP-IDF and clone
git clone --recursive https://github.com/espressif/esp-idf.git


ESP-IDF will be downloaded into ``~/esp/esp-idf``.
ESP-IDF will be downloaded into ``~/esp/esp-idf``.

Note the ``--recursive`` option! If you have already cloned ESP-IDF without this option, run another command to get all the submodules::

Expand Down Expand Up @@ -136,7 +138,7 @@ In Terminal.app, go to the application directory which was obtained on the previ

cd ~/esp/myapp

Type a command like this to set the path to ESP-IDF directory::
Type a command like this to set the path to ESP-IDF directory::

export IDF_PATH=~/esp/esp-idf

Expand All @@ -160,4 +162,3 @@ Further reading
===============

If you'd like to use the Eclipse IDE instead of running ``make``, check out the Eclipse setup guide in this directory.

4 changes: 2 additions & 2 deletions docs/windows-setup.rst
Expand Up @@ -9,7 +9,7 @@ Windows doesn't have a built-in "make" environment, so as well as installing the

The quick setup is to download the Windows all-in-one toolchain & MSYS zip file from dl.espressif.com:

https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20160816.zip
https://dl.espressif.com/dl/esp32_win32_msys2_environment_and_toolchain-20170111.zip

Unzip the zip file to C:\ and it will create an "msys32" directory with a pre-prepared environment.

Expand Down Expand Up @@ -38,7 +38,7 @@ Another Alternative Step 1: Just download a toolchain

If you already have an MSYS2 install or want to do things differently, you can download just the toolchain here:

https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-59.zip
https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-61-gab8375a-5.2.0.zip

If you followed one of the above options for Step 1, you won't need this download.

Expand Down
27 changes: 27 additions & 0 deletions make/project.mk
Expand Up @@ -421,3 +421,30 @@ endef
# filter/subst in expression ensures all submodule paths begin with $(IDF_PATH), and then strips that prefix
# so the argument is suitable for use with 'git submodule' commands
$(foreach submodule,$(subst $(IDF_PATH)/,,$(filter $(IDF_PATH)/%,$(COMPONENT_SUBMODULES))),$(eval $(call GenerateSubmoduleCheckTarget,$(submodule))))


# Check toolchain version using the output of xtensa-esp32-elf-gcc --version command.
# The output normally looks as follows
# xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-59-ga194053) 4.8.5
# The part in brackets is extracted into TOOLCHAIN_COMMIT_DESC variable,
# the part after the brackets is extracted into TOOLCHAIN_GCC_VER.
ifndef MAKE_RESTARTS
TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(([^)]*).*|\1|gp')
TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc\ \(.*\)\ (.*)|\1|gp')

# Officially supported version(s)
SUPPORTED_TOOLCHAIN_COMMIT_DESC := crosstool-NG crosstool-ng-1.22.0-61-gab8375a
SUPPORTED_TOOLCHAIN_GCC_VERSIONS := 5.2.0

ifneq ($(TOOLCHAIN_COMMIT_DESC), $(SUPPORTED_TOOLCHAIN_COMMIT_DESC))
$(info WARNING: Toolchain version is not supported: $(TOOLCHAIN_COMMIT_DESC))
$(info Expected to see version: $(SUPPORTED_TOOLCHAIN_COMMIT_DESC))
$(info Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.)
endif
ifeq (,$(findstring $(TOOLCHAIN_GCC_VER), $(SUPPORTED_TOOLCHAIN_GCC_VERSIONS)))
$(warning WARNING: Compiler version is not supported: $(TOOLCHAIN_GCC_VER))
$(info Expected to see version(s): $(SUPPORTED_TOOLCHAIN_GCC_VERSIONS))
$(info Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.)
endif
endif #MAKE_RESTARTS

2 comments on commit 8d2199e

@Tubbles
Copy link

@Tubbles Tubbles commented on 8d2199e Jan 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also update this file?

windows_install_prerequisites.sh:
33 line: TOOLCHAIN_ZIP=xtensa-esp32-elf-win32-1.22.0-59.zip

Same as michal037, running on windows; will not receive the newest toolchain.

@wa67
Copy link

@wa67 wa67 commented on 8d2199e Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.