diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 490df56..7015bb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/README.md b/README.md index 757a12c..25a1fbe 100644 --- a/README.md +++ b/README.md @@ -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 , 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 @@ -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 @@ -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 @@ -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 diff --git a/boards/esp32c3_devkitm.conf b/boards/esp32c3_devkitm.conf index 5c37cfc..f7a7e8e 100644 --- a/boards/esp32c3_devkitm.conf +++ b/boards/esp32c3_devkitm.conf @@ -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 diff --git a/boards/esp32c3_devkitm.overlay b/boards/esp32c3_devkitm.overlay index ea9865c..4fb2ab8 100644 --- a/boards/esp32c3_devkitm.overlay +++ b/boards/esp32c3_devkitm.overlay @@ -7,3 +7,7 @@ &wifi { status = "okay"; }; + +&coretemp { + status = "okay"; +}; diff --git a/sample.yaml b/sample.yaml index a199e23..6b63c11 100644 --- a/sample.yaml +++ b/sample.yaml @@ -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"