Skip to content

ChromeOS ESP32 Initial Setup

Initial Dependencies

Before you can develop and compile code to run on an ESP32 Microcontroller, you will need to install several dependencies that are not installed by default on ChromeOS. This can be done by running the following commands in the ChromeOS Linux Terminal. 

sudo apt install git wget flex bison gperf git
sudo apt install python3 python3-pip python3-venv 
sudo apt install cmake ninja-build ccache libffi-dev 
sudo apt install libssl-dev dfu-util libusb-1.0-0

Install Espressif IDF Libraries

To build applications for the ESP32, you need the software libraries provided by Espressif.

mkdir -p ~/esp
cd ~/esp
git clone -b v5.2.3 --recursive https://github.com/espressif/esp-idf.git
cd ~/esp/esp-idf
./install.sh esp32

The ESP IDF Libraries will need to be refrenced in your shell before use, You can run the following command to automatically refrence the tools every time you open your ChromeOS Linux Terminal.

echo '. $HOME/esp/esp-idf/export.sh' >> ~/.bashrc

Visual Studio Integration

It is strongly recommended to use Visual Studio Code to build ESP32 Projects. Before continuing, Please follow the dedicated ChromeOS Guide to Installing VSCode on ChromeOS.

Once Visual Studio Code is installed, run the following command in your ChromeOS Linux Terminal to install the Espressif ESP-IDF Extension into VSCode.

code --install-extension espressif.esp-idf-extension

Once the ESP32 VSCode Extension has been installed, Launch VSCode and select the ESP-IDF Extension to complete the setup using the "Express" option, which will perform all the steps needed to complete the setup. This process will take several minutes to complete.

Once you have completed the setup, you will need to run the following command to setup the Linux udev rules to allow you to interact with the ESP32 hardware. 

sudo cp -n ~/.espressif/tools/openocd-esp32/v0.12.0-esp32-20240821/openocd-esp32/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
sudo udevadm control --reload-rules