Skip to content
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

noahp/twister #7

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
58 changes: 32 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,27 @@ on:

jobs:
build:
strategy:
fail-fast: false
matrix:
board: [esp32c3_devkitm, esp32s3_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: xtensa-espressif_esp32s3_zephyr-elf riscv64-zephyr-elf

- name: 💾 Cache ~/.cache/ccache
uses: actions/cache@v3
Expand All @@ -43,13 +41,21 @@ 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 zephyr-esp32-example \
-- \
-DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\"
# not part of action-zephyr-setup
west blobs fetch hal_espressif

zephyr/scripts/twister
--platform ${{ matrix.board }}
--testsuite-root zephyr-esp32-example

ccache -sv

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: twister-artifacts
path: |
twister-out/**/*.log
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
> [!IMPORTANT]
>
> 🚧 This example repo is using an experimental version of the [Memfault
> Firmware SDK](https://github.com/memfault/memfault-firmware-sdk). Feel free to
> test it out and send us any feedback at <[email protected]>, but expect
> this example to have some missing functionality or other undocumented
> limitations! 🚧

# Memfault Zephyr + ESP32C3 Example
# Memfault Zephyr + ESP32 Example

This sample app is based on the Zephyr `samples/net/wifi` example. It
demonstrates a Zephyr + ESP32 integration with the Memfault SDK. It has been
Expand All @@ -28,16 +20,16 @@ To try out this example app:
2. Create a zephyr workspace and set it up with this project:

```bash
$ mkdir zephyr-workspace
$ cd zephyr-workspace
$ west init -m https://github.com/memfault/zephyr-esp32-example
$ west update
mkdir zephyr-workspace
cd zephyr-workspace
west init -m https://github.com/memfault/zephyr-esp32-example
west update
```

3. Build the example app:

```bash
$ west build zephyr-esp32-example --sysbuild
west build zephyr-esp32-example --sysbuild
```

`--sysbuild` will build the MCUboot image as well, which will also get
Expand All @@ -47,7 +39,7 @@ To try out this example app:
4. Flash the example app:

```bash
$ west flash
west flash
```

5. Open a serial console and interact with the sample app shell. For example
Expand Down Expand Up @@ -79,6 +71,9 @@ The payload to upload to Memfault is:
build/zephyr-esp32-example/zephyr/zephyr.signed.confirmed.bin
```

This file is set as "confirmed", so it won't revert after 1 boot cycle (not safe
against bootloops!). See the [Zephyr documentation](https://docs.zephyrproject.org/apidoc/3.6.0/group__mcuboot__api.html#ga95ccc9e1c7460fec16b9ce9ac8ad7a72) for details.

Follow the normal Memfault OTA workflow:

1. build and flash an image with a version like `0.0.1` (see the
Expand Down
4 changes: 3 additions & 1 deletion boards/esp32c3_devkitm.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CONFIG_WIFI=y
CONFIG_HEAP_MEM_POOL_SIZE=98304

# For now, capture smaller coredumps to fit available RAM
CONFIG_MEMFAULT_RAM_BACKED_COREDUMP_SIZE=1024

CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
Expand Down
4 changes: 4 additions & 0 deletions boards/esp32c3_devkitm.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
&wifi {
status = "okay";
};

&coretemp {
status = "okay";
};
49 changes: 9 additions & 40 deletions sample.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
common:
harness: net
tags:
- net
- wifi
tags: memfault
platform_allow: >
esp32c3_devkitm esp32s3_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"
Loading