Set up ESP-IDF for ESP32
The Golioth Firmware SDK can be installed as a component of the ESP-IDF. This delivers a set of APIs that let you use Golioth with any ESP-IDF based projects. This guide will walk through the process of installing both the ESP-IDF and the Golioth Firmware SDK.
Install ESP-IDF
- Linux
- MacOS
- Windows
1. Install dependencies
sudo apt update
sudo apt-get install git wget flex bison gperf python3 python3-venv \
python3-pip python3-setuptools cmake ninja-build ccache libffi-dev \
libssl-dev dfu-util libusb-1.0-0
2. Clone the ESP-IDF Repository and set up the tools
mkdir -p ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git -b v5.3.0
cd esp-idf
./install.sh all
1. Install dependencies
brew install cmake ninja dfu-util python3
sudo easy_install pip
2. Clone the ESP-IDF repository and set up the tools
mkdir -p ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git -b v5.3.0
cd esp-idf
./install.sh all
1. Use the ESP-IDF Installer
Espressif provides comprehensive instructions for installing ESP-IDF for Windows. It recommends using the ESP-IDF Tools Installer which installs and configures all required ESP-IDF tools for Windows systems.
Install Golioth Firmware SDK
- Linux
- MacOS
- Windows
Clone the Golioth Firmware SDK repository and update submodules recursively
cd ~
git clone --recursive https://github.com/golioth/golioth-firmware-sdk.git -b v0.15.0
Clone the Golioth Firmware SDK repository and update submodules
cd ~
git clone --recursive https://github.com/golioth/golioth-firmware-sdk.git -b v0.15.0
Clone the Golioth Firmware SDK repository and update submodules
cd %HOMEPATH%
git clone --recursive https://github.com/golioth/golioth-firmware-sdk.git -b v0.15.0
Set the ESP IDF environment variables
Each time you begin a new terminal session, environment variables must be set to locate the ESP-IDF tools. This is an automated process using the single-line command shown below. Note that if the idf.py
command is not found it usually indicates that these variable have not yet been set.
- Linux
- MacOS
- Windows
source ~/esp/esp-idf/export.sh
source ~/esp/esp-idf/export.sh
%HOMEPATH%\esp\esp-idf\export.bat
Sample build
Your system is all set up and ready to start building & flashing with the ESP-IDF. Verify by building a Hello World sample:
- Linux
- MacOS
- Windows
cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
cd hello_world
idf.py set-target esp32
idf.py build
cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
cd hello_world
idf.py set-target esp32
idf.py build
cd %HOMEPATH%\esp
xcopy /e /i %IDF_PATH%\examples\get-started\hello_world hello_world
cd hello_world
idf.py set-target esp32
idf.py build