Zephyr OS on EPS32 & Flash remotely

A project log for Industrial Network Playground

This is a remote playground to learn more about different types of software components that can be used in industrial setups.

nikolaNikola 12/03/2023 at 21:190 Comments

Zephyr OS on ESP32
As mentioned in the description, all three modules of the M5Stack are ESP32s. I already had my Zephyr toolchain set up for ARM, but I had never used Zephyr on an ESP32 before. I found this Youtube channel very helpful:

TIP: If you write your Zephyr code outside the usual zephyr folder, do not forget to source the file before building the project!

$ source ../../zephyrproject/zephyr/
$ west build -b esp32

Remote flash
As mentioned in the description, I want everything to be available remotely. But to flash Zephyr OS, I would need the toolchain on the Raspberry Pi. The Raspi runs Raspberry Pi OS. I learned from the internet that it is not easy/possible to set up the Zephyr OS toolchain for this operating system. It is recommended to use Ubuntu on the Raspi for this use case. Unfortunately, I had already set up my Raspi as an edge router for OpenThread with the Raspberry Pi OS and did not want to do that again. So I found a Linux tool called usbip. With this tool it is possible to mount a USB port over the network. Everything I need to do is written here: