Skip to content

Add esp32 build + twister #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 35 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,34 @@ on:

jobs:
build:
# Project setup dominates vs. actual per-configuration build times, so
# just run twister for all boards instead of splitting into separate jobs.
# strategy:
# matrix:
# board:
# [
# esp_wrover_kit/esp32/procpu,
# esp32s3_devkitm/esp32s3/procpu,
# esp32s3_devkitc/esp32s3/procpu,
# esp32c3_devkitm,
# ]
runs-on: ubuntu-latest
container:
# Zephyr toolchain from here:
# https://github.com/zephyrproject-rtos/docker-image/pkgs/container/ci
image: ghcr.io/zephyrproject-rtos/ci:v0.26.6
env:
# Tell cmake where to find the zephyr sdk
CMAKE_PREFIX_PATH: /opt/toolchains

steps:
- name: Checkout code
- name: ☑️ Checkout
uses: actions/checkout@v4
with:
path: zephyr-workspace/zephyr-esp32-example
path: zephyr-esp32-example

- name: ♻️ Initialize Zephyr Workspace
# Set up the Zephyr workspace and install the Python dependencies
run: |
cd zephyr-workspace
rm -rf .west
west init -l zephyr-esp32-example
west update --narrow -o=--depth=1
west blobs fetch hal_espressif
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: ♻️ Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: zephyr-esp32-example
toolchains: riscv64-zephyr-elf:xtensa-espressif_esp32_zephyr-elf:xtensa-espressif_esp32s3_zephyr-elf

- name: 💾 Cache ~/.cache/ccache
uses: actions/cache@v3
Expand All @@ -43,27 +48,19 @@ jobs:
restore-keys: |
ccache-v1-${{ runner.os }}-

- name: 🔨 Build Project
- name: 🌪️ Run twister
run: |
cd zephyr-workspace
ccache -z

west build --sysbuild \
--pristine=always \
--board=esp32s3_devkitm/esp32s3/procpu zephyr-esp32-example \
-- \
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"

west build --sysbuild \
--pristine=always \
--board=esp32s3_devkitc/esp32s3/procpu zephyr-esp32-example \
-- \
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
# not part of action-zephyr-setup
west blobs fetch hal_espressif

west build --sysbuild \
--pristine=always \
--board=esp32c3_devkitm zephyr-esp32-example \
-- \
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
zephyr/scripts/twister --testsuite-root zephyr-esp32-example

ccache -sv

- name: 🎨 Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: twister-artifacts
path: |
twister-out/**/*.log
2 changes: 0 additions & 2 deletions boards/esp32s3_devkitc_esp32s3_procpu.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CONFIG_NET_LOG=y

# Enable external SPI RAM
CONFIG_SPI=y
CONFIG_ESP_SPIRAM=y
5 changes: 5 additions & 0 deletions boards/esp32s3_devkitc_esp32s3_procpu.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
&coretemp {
status = "okay";
};

/* 2MB psram. This assumes target board is the ESP32-S3-DevKitC-1-N8R2 */
&psram0 {
size = <DT_SIZE_M(2)>;
};
1 change: 0 additions & 1 deletion boards/esp32s3_devkitm_esp32s3_procpu.conf
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
CONFIG_NET_LOG=y
Empty file.
3 changes: 3 additions & 0 deletions boards/esp_wrover_kit_procpu.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
&wifi {
status = "okay";
};
55 changes: 15 additions & 40 deletions sample.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,18 @@
common:
harness: net
tags:
- net
- wifi
tags: memfault
platform_allow:
- esp_wrover_kit/esp32/procpu
- esp32s3_devkitm/esp32s3/procpu
- esp32s3_devkitc/esp32s3/procpu
- esp32c3_devkitm
sample:
description: Test wifi driver and APIs functionality
name: WiFi sample app
description: Memfault Zephyr ESP32 Example
name: zephyr-esp32-example
tests:
sample.net.wifi:
platform_allow:
- cc3220sf_launchxl
- disco_l475_iot1
- reel_board
integration_platforms:
- cc3220sf_launchxl
sample.net.wifi.mikroe_wifi_bt_click:
extra_args: SHIELD=mikroe_wifi_bt_click_mikrobus
platform_allow: lpcxpresso55s69_cpu0
sample.net.wifi.esp_8266:
extra_args: SHIELD=esp_8266
platform_allow: sam4e_xpro
sample.net.wifi.esp_8266_arduino:
extra_args: SHIELD=esp_8266_arduino
platform_allow:
- frdm_k64f
- disco_l475_iot1
integration_platforms:
- frdm_k64f
sample.net.wifi.inventek_eswifi_arduino_uart:
extra_args: SHIELD=inventek_eswifi_arduino_uart
platform_allow:
- frdm_k64f
- nucleo_f767zi
integration_platforms:
- frdm_k64f
sample.net.wifi.inventek_eswifi_arduino_spi:
extra_args: SHIELD=inventek_eswifi_arduino_spi
platform_allow:
- frdm_k64f
- nucleo_f767zi
integration_platforms:
- frdm_k64f
sample.build:
build_only: true
extra_configs:
- CONFIG_MEMFAULT_PROJECT_KEY="dummy"
# when building with a symlinked test Memfault SDK module, need to disable
# the meta build output, otherwise it will fail as post-link.
- CONFIG_BUILD_OUTPUT_META=n
5 changes: 3 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest:
projects:
- name: zephyr
url: https://github.com/zephyrproject-rtos/zephyr
revision: v4.0.0
revision: v4.1.0
import:
# Limit the Zephyr modules to the required set
name-allowlist:
Expand All @@ -13,4 +13,5 @@ manifest:
- name: memfault-firmware-sdk
url: https://github.com/memfault/memfault-firmware-sdk
path: modules/lib/memfault-firmware-sdk
revision: 1.17.0
# Temporarily use a fork with ESP32 support, until 1.26.0 is released
revision: noahp/1.25.0+esp32-support