Wednesday, November 9, 2016

ESP32 Linux development environment

To setup the development environment for ESP32 is more simple like it was for the ESP8266.

There are few easy steps ( you can found them also here).

1. Download lubuntu-16.04.1-desktop-amd64.iso file and the 
After you installed you lubuntu VM ( 64 bits) and the VBoxGuestAdditions_5.1.6.iso ( for full screen, shared directories between the windows and Linux, shared clipboard)

2.Install the Lubuntu iso image using the Virtual Box

3.Open a terminal and issue sudo apt install build-essential

4.Mount the VBoxGuestAdditions_5.1.6.iso and run the VBoxLinuxAdditions.run as root from /media/your_username/VBOXADDITIONS_5.1.6_110634 directory



Now you are ready to install the ESP32 environment.
You can follow the steps from 5 to 10 or get the right scripts from https://github.com/bcatalin/ESP32 and run it. It will do the steps from 5 to 10 for you.



5. Install the applications:
sudo apt-get install gawk gperf grep gettext ncurses python python-dev automake bison flex texinfo help2man libtool

6.Create a directory:
 make ~/esp32
This will create a directory in the /home/<your_username>/

7.Download the binary toolchain
cd ~/esp32
wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-59.tar.gz
Untar the archive using 

tar xvf xtensa-esp32-elf-linux64-1.22.0-59.tar.gz

This will create a directory named xtensa-esp32-elf/ int the /home/<your_user>/esp32/

7.Update the PATH variable with the xtensa toolchain

export PATH=$PATH:$HOME/esp32/xtensa-esp32-elf/bin
Attention: This command will set the PATH just for the current terminal and for the current session. To make this permanent update the .bashrc file in the /home/<your_name>/ directory.

To check this open a new terminal and issue the command 

echo $PATH 

and you should see the esp32/xtensa-esp32-elf/bin in the output.

8. Get ESP-IDF from github

cd ~/esp32
git clone --recursive https://github.com/espressif/esp-idf.git
cd ~/esp32/esp-idf
git submodule update --init
9.Download a template application
cd ~/esp32
git clone https://github.com/espressif/esp-idf-template.git myapp
You will have now in the /home/<your_username>/esp32 a directory named myapp.

Update again the .bashrc file if you are not planning to move the IDF directory and add the following line at the end of /home/<your_username>/.bashrc

export IDF_PATH=$(pwd)/esp32/esp-idf

10. Configure and run your firs application

Go to /home/<your_username>/esp32/myapp and issue command

make menuconfig

that will adapt the sdkconfig according to your project and then compile it with

make


To flash it to the ESP32 use the 

make flash 

command.


Job done !











No comments:

Post a Comment