
sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python python-
pip python-setuptools python-serial python-cryptography python-future python-pyparsing
python-pyelftools
Arch
:
sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial python2-
cryptography python2-future python2-pyparsing python2-pyelftools
Set up The Toolchain
64-bit Linux
:
https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-esp32-2019r1-8.2.0.tar.gz
32-bit Linux
:
https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-esp32-2019r1-8.2.0.tar.gz
1. Unzip the file to
~/esp
directory:
64-bit Linux
:
mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-esp32-2019r1-8.2.0.tar.gz
32-bit Linux
:
mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-esp32-elf-linux32-esp32-2019r1-8.2.0.tar.gz
2. The toolchain will be unzipped to
~/esp/xtensa-esp32-elf/
directory.
Add the following to
~/.profile
:
export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"
Optionally, add the following to
~/.profile
:
alias get_esp32='export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"'
3. Re-log in to validate
.profile
. Run the following to check PATH:
printenv PATH
$ printenv PATH
/home/user-name/esp/xtensa-esp32-elf/bin:/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
Permission issues /dev/ttyUSB0
With some Linux distributions you may get the Failed to open port /dev/ttyUSB0 error
message when flashing the ESP32. This can be solved by adding the current user to
the dialout group.
Arch Linux Users
To run the precompiled gdb (xtensa-esp32-elf-gdb) in Arch Linux requires ncurses 5,
but Arch uses ncurses 6.