This lab walks you through building three Zephyr applications for Sparrow:
Open a terminal in your Zephyr workspace and run:
west --version west boards | grep esp32c6
If the board (ESP32C6 Xiao) is listed and west works, continue.
Tip: If you switch branches or update modules often, use:
> west update
Each lab uses the same basic structure:
<APP_ROOT>/
CMakeLists.txt
prj.conf
src/
main.c
boards/
esp32c6_devkitc_esp32c6_hpcore.overlay
(optional) Kconfig
Build command used in all labs:
west build -b esp32c6_devkitc/esp32c6/hpcore -p auto .
Flash:
west flash -d build --runner esp32
Monitor serial output:
screen <your_port_name> 115200
Build a UART shell application that includes standard Zephyr shell commands and adds a custom command:
i2c_scan — scans the I2C bus for responding device addressessparrow$help, kernel, device, log, etc.i2c_scan
Create a new folder, e.g. sparrow_console and unzip the project here.
sparrow_shell_i2c_scan/ CMakeLists.txt prj.conf src/main.c boards/esp32c6_devkitc_esp32c6_hpcore.overlay
Build:
west build -b esp32c6_devkitc/esp32c6/hpcore -p auto .
Flash:
west flash -d build --runner esp32
Open the serial console and test:
helpi2c_scanExpected: you see a list of detected I2C addresses or “no devices found”.
Build a shell app that provides a “Linux-like” file navigation experience (as much as Zephyr supports), using:
Typical workflow in shell:
fs mount (or auto-mount at boot)ls /lfscd /lfspwd
Create a new folder, e.g. sparrow_littlefs and unzip the project here.
Build:
west build -b esp32c6_devkitc/esp32c6/hpcore -p auto .
Flash:
west flash -d build --runner esp32
Test in shell:
fs (to see available fs commands)ls /ls /lfs (it is mounted at boot)cd /lfspwdfs mkdir /lfs/folder1fs write /lfs/folder1/hello.txt -o 0 48 65 6c 6c 6f 20 57 6f 72 6c 64 21fs cat /lfs/folder1/hello.txtExpected: you can navigate the mount point and list directory contents, create and view files, etc..
storage_partition labelstorage partition exists in build/zephyr/zephyr.dtsCONFIG_FS_SHELL (and any related symbols) are enabled
Usage examples:
bme_log start 5
bme_log status
bme_log interval 10
bme_log stop
fs cat /lfs/logs/bme_log.dat
Build a webserver that:
Wi‑Fi + TLS stacks can be memory hungry. For a simple HTTP server:
Create a new folder, e.g. sparrow_web and unzip the project here.
Build:
west build -b esp32c6_devkitc/esp32c6/hpcore -p auto .
Flash:
west flash -d build --runner esp32
The code runs a HTTP static file server backed by LittleFS and auto-started at boot; it serves files from /lfs/www on port 8080 and uses the HTTP server’s static_fs handler.
In the serial shell, you need to run the following commands:
1. Connect to WiFi:
wifi scan wifi connect -s "SSID" -p "PASS" -k 1 wifi status
2. Check the webserver is up and running and get the board IP address:
net http net iface
3. Write a simple index.html file into /lfs/www:
fs write /lfs/www/index.html -o 0 3c 68 31 3e 48 69 3c 2f 68 31 3e
4. Browse: http://[board-ip]:8080/
Expected: