Zephyr RTOS ESP32 blinky

Hardware

System requirements

Other distributions will require different packages.

sudo xbps-install -S gcc ninja cmake make python3 python3-devel python3-pip
sudo xbps-install -S gcc-multilib glibc-devel-32bit libgcc-devel-32bit

Install toolchain for real hardware

mkdir ~/Toolchain
cd ~/Toolchain
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v1.0.1/zephyr-sdk-1.0.1_linux-x86_64_gnu.tar.xz
tar xvf zephyr-sdk-1.0.1_linux-x86_64_gnu.tar.xz
cd zephyr-sdk-1.0.1
./setup.sh

Getting started with a project

# Clone
git clone git@github.com:mitjafelicijan/zephyr-esp32-blinky.git
cd zephyr-esp32-blinky

# Environment
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install west
west packages pip --install

# Fetch requirements and tooling
west init
west update
west zephyr-export

# Go to application directory
cd apps/blinky

# Compile and run on host
make host-build
make host-run

# Compile and flash ESP32 board
make esp-build
make esp-flash

# Serial monitor of ESP32
make esp-monitor