From 9fea3919b511e03593a0b3b97df6857f3264fe36 Mon Sep 17 00:00:00 2001 From: Gillian Minnehan Date: Fri, 9 Aug 2024 09:06:05 -0500 Subject: [PATCH 1/2] # This is a combination of 4 commits. # This is the 1st commit message: chore(zephyr): upgrade to Zephyr v3.7.0 - Enable CONFIG_POSIX_API=y for zephyr 3.7.0 support - Fix readme and add hash algorithm requirement --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- ...32s3_devkitm.conf => esp32s3_devkitm_esp32s3_procpu.conf} | 0 ...evkitm.overlay => esp32s3_devkitm_esp32s3_procpu.overlay} | 0 prj.conf | 5 +++-- west.yml | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) rename boards/{esp32s3_devkitm.conf => esp32s3_devkitm_esp32s3_procpu.conf} (100%) rename boards/{esp32s3_devkitm.overlay => esp32s3_devkitm_esp32s3_procpu.overlay} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a8635c..2cf0c21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: west build --sysbuild \ --pristine=always \ - --board=esp32s3_devkitm zephyr-esp32-example \ + --board=esp32s3_devkitm/esp32s3/procpu zephyr-esp32-example \ -- \ -DCONFIG_MEMFAULT_PROJECT_KEY=\"1234\" diff --git a/README.md b/README.md index 25a1fbe..d058150 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ demonstrates a Zephyr + ESP32 integration with the Memfault SDK. It has been tested on the following boards: - `esp32c3_devkitm` (default board) -- `esp32s3_devkitm` +- `esp32s3_devkitm/esp32s3/procpu` ## Getting Started @@ -56,7 +56,7 @@ To try out this example app: [00:09:21.911,000] mflt: HW version: esp32c3_devkitm # connect wifi - uart:~$ wifi connect + uart:~$ wifi connect -s "" -k -p "" # test memfault export over uart uart:~$ mflt export diff --git a/boards/esp32s3_devkitm.conf b/boards/esp32s3_devkitm_esp32s3_procpu.conf similarity index 100% rename from boards/esp32s3_devkitm.conf rename to boards/esp32s3_devkitm_esp32s3_procpu.conf diff --git a/boards/esp32s3_devkitm.overlay b/boards/esp32s3_devkitm_esp32s3_procpu.overlay similarity index 100% rename from boards/esp32s3_devkitm.overlay rename to boards/esp32s3_devkitm_esp32s3_procpu.overlay diff --git a/prj.conf b/prj.conf index 77dca50..d77fe99 100644 --- a/prj.conf +++ b/prj.conf @@ -41,11 +41,11 @@ CONFIG_NET_L2_WIFI_SHELL=y CONFIG_MEMFAULT=y CONFIG_MEMFAULT_LOGGING_ENABLE=y CONFIG_MEMFAULT_HTTP_ENABLE=y -CONFIG_MEMFAULT_TLS_CERTS_USE_DER=y CONFIG_MEMFAULT_HTTP_PERIODIC_UPLOAD=y # Additional network configuration for Memfault features CONFIG_DNS_RESOLVER=y +CONFIG_POSIX_API=y CONFIG_NET_SOCKETS=y CONFIG_TLS_CREDENTIALS=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y @@ -53,6 +53,7 @@ CONFIG_NET_STATISTICS=y CONFIG_NET_STATISTICS_USER_API=y # MbedTLS config +CONFIG_MBEDTLS_SHA1=y CONFIG_MBEDTLS_SERVER_NAME_INDICATION=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=30000 @@ -76,7 +77,7 @@ CONFIG_MEMFAULT_COREDUMP_COLLECT_TASKS_REGIONS=n # Memfault's http client needs a small amount of heap. Zephyr requires a minimum # heap size for the applied configuration, so select that here to prevent a # build time message -CONFIG_HEAP_MEM_POOL_SIZE=51200 +CONFIG_HEAP_MEM_POOL_SIZE=52224 CONFIG_SYS_HEAP_RUNTIME_STATS=y CONFIG_SHELL_STACK_SIZE=4096 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 diff --git a/west.yml b/west.yml index 01bec9a..e86e7ed 100644 --- a/west.yml +++ b/west.yml @@ -2,7 +2,7 @@ manifest: projects: - name: zephyr url: https://github.com/zephyrproject-rtos/zephyr - revision: v3.6.0 + revision: v3.7.0 import: # Limit the Zephyr modules to the required set name-allowlist: @@ -13,4 +13,4 @@ manifest: - name: memfault-firmware-sdk url: https://github.com/memfault/memfault-firmware-sdk path: modules/lib/memfault-firmware-sdk - revision: 1.10.1 + revision: 1.11.2 From ba4fcbac39ef2afae66dbbe81d5c7c546ac70210 Mon Sep 17 00:00:00 2001 From: Gillian Minnehan Date: Wed, 11 Sep 2024 12:18:36 -0400 Subject: [PATCH 2/2] Enable build for c3, change default board --- CMakeLists.txt | 2 +- README.md | 6 ++++-- boards/esp32c3_devkitm.conf | 10 +++++++++- prj.conf | 1 + west.yml | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 515d549..800e273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 # Default board -set(BOARD esp32c3_devkitm) +set(BOARD esp32s3_devkitm/esp32s3/procpu) cmake_minimum_required(VERSION 3.20.0) diff --git a/README.md b/README.md index d058150..a88f634 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ 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 tested on the following boards: -- `esp32c3_devkitm` (default board) -- `esp32s3_devkitm/esp32s3/procpu` +- `esp32s3_devkitm/esp32s3/procpu` (default board) +- `esp32c3_devkitm`* + +\* _NOTE: Currently does not have support for data upload. Export chunks to memfault with `mflt export` and upload via the [chunks debug log](https://mflt.io/chunks-debug). ## Getting Started diff --git a/boards/esp32c3_devkitm.conf b/boards/esp32c3_devkitm.conf index f7a7e8e..9d37f54 100644 --- a/boards/esp32c3_devkitm.conf +++ b/boards/esp32c3_devkitm.conf @@ -11,4 +11,12 @@ CONFIG_NET_IPV4=y CONFIG_NET_DHCPV4=y CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y -CONFIG_NET_LOG=y +# Override selections from prj.conf to save space on this chip +CONFIG_LOG=y +CONFIG_NET_LOG=n +CONFIG_MEMFAULT_LOGGING_ENABLE=n +CONFIG_NET_SHELL=n + +# TODO: Add support for TLS on this chip +# Removed to free up RAM and allow build check to succeed. +CONFIG_MBEDTLS_HEAP_SIZE=0 diff --git a/prj.conf b/prj.conf index d77fe99..a68d198 100644 --- a/prj.conf +++ b/prj.conf @@ -60,6 +60,7 @@ CONFIG_MBEDTLS_HEAP_SIZE=30000 CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096 CONFIG_MBEDTLS_MEMORY_DEBUG=y CONFIG_MBEDTLS_SHELL=y +CONFIG_MBEDTLS_AES_ROM_TABLES=y # More verbose Memfault component logs CONFIG_MEMFAULT_LOG_LEVEL_DBG=y diff --git a/west.yml b/west.yml index e86e7ed..b31534b 100644 --- a/west.yml +++ b/west.yml @@ -13,4 +13,4 @@ manifest: - name: memfault-firmware-sdk url: https://github.com/memfault/memfault-firmware-sdk path: modules/lib/memfault-firmware-sdk - revision: 1.11.2 + revision: 1.11.4