ESP32 Thing Hookup Guide
Installing the ESP32 Arduino Core
The pair of Tensilica cores in the ESP32 are Xtensa-based – not your standard ARM or AVR. Fortunately, there is still a GNU compiler available for the ESP32, which opens up a a world of possible development environment (IDE) set ups! The rest of this tutorial covers setting up the Arduino IDE with ESP32 support, and documents a few simple example sketches to help get your WiFi/BLE microcontroller off the ground.
In abstracting away a lot of the complicated overhead, the Arduino IDE for the ESP32 also eliminates access to some of the SoC's more advanced features. If you'd like to try your hand at setting up a more advanced toolchain for the ESP32, we recommend checking out Espressif's esp-idf GitHub repository. The esp-idf – short for IoT Development Framework – is Espressif's software development kit (SDK) for the ESP32.
Installing the ESP32 Core
Espressif’s official ESP32 Arduino core is hosted here on GitHub. They don’t have an Arduino board manager install yet (it should be coming soon), but they do have a simple set of installation directions to help.
Clone or Download the Core
To install the ESP32 board definitions, you’ll need download the contents of the esp32-arduino repository, and place them in a “hardware/espressif/esp32” directory in your Arduino sketchbook directory. You can either download those files using the git command line tool, or by downloading them from GitHub.
C:/Program Files (x86)/Arduino/hardwareand on Mac that may be
If you have git, open a terminal, navigate to your Arduino sketchbook, and type:
mkdir hardware cd hardware mkdir espressif cd espressif git clone https://github.com/espressif/arduino-esp32.git esp32
Those commands will make a “hardware” and “espressif” directories, then download the arduino-esp32 GitHub repository into an “esp32” folder.
If you don’t have git, click here to download the core (or click “Download” > “Download ZIP” on the GitHub page), and unzip it to an espressif/esp32 directory in your Arduino sketchbook.
“boards.txt”, “platform.txt”, and the cores, doc, tools, etc. folders should all live in the esp32 directory.
Install the Xtensa and ESP32 Tools
To compile code for the ESP32, you need the Xtensa GNU compiler collection (GCC) installed on your machine. Windows users can run get.exe, found in the “esp32/tools” folder.
Windows users can run “get.exe” to download the ESP32 software tools.
Mac and Linux users should run the tools/get.py python script to download the tools. Using a terminal, navigate to the esp32/tools folder. Then type:
The “get.py” python script will download the Xtensa GNU tools and the ESP32 software development kit (SDK), and unzip them to the proper location. You should see a few new folders in the “tools” directory, including “sdk” and “xtensa-esp32-elf” once it’s done.