From ee928775e058d95015a9b52a870a4c53ea6cec12 Mon Sep 17 00:00:00 2001 From: Noah Pendleton <2538614+noahp@users.noreply.github.com> Date: Fri, 21 Nov 2025 18:01:05 -0500 Subject: [PATCH] Update Memfault SDK to 1.30.3 and Zephyr to 4.3.0 Add esp32c6 board. ```bash uart:~$ wifi connect -k 1 -s -p Connection requested [00:00:20.404,000] net_dhcpv4: Received: 192.168.1.170 Connected uart:~$ mflt post_chunks [00:00:23.828,000] mflt: Posting Memfault Data [00:00:23.829,000] mflt: memfault_platform_log: Opening socket to chunks.memfault.com:443 [00:00:23.876,000] mflt: memfault_platform_log: DNS lookup for chunks.memfault.com = 98.90.183.58 [00:00:24.303,000] mflt: memfault_platform_log: Response Complete: Parse Status 0 HTTP Status 202! [00:00:24.304,000] mflt: memfault_platform_log: Body: Accepted [00:00:24.309,000] mflt: memfault_platform_log: No more data to send [00:00:24.320,000] mflt: Data posted successfully, 62 bytes sent ``` --- boards/esp32c6_devkitc_esp32c6_hpcore.overlay | 13 +++++++ boards/esp32s3_devkitm_esp32s3_procpu.conf | 0 prj.conf | 3 -- sample.yaml | 1 + src/main.c | 34 ++++++------------- west.yml | 4 +-- 6 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 boards/esp32c6_devkitc_esp32c6_hpcore.overlay delete mode 100644 boards/esp32s3_devkitm_esp32s3_procpu.conf diff --git a/boards/esp32c6_devkitc_esp32c6_hpcore.overlay b/boards/esp32c6_devkitc_esp32c6_hpcore.overlay new file mode 100644 index 0000000..b417db0 --- /dev/null +++ b/boards/esp32c6_devkitc_esp32c6_hpcore.overlay @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wifi { + status = "okay"; +}; + +&coretemp { + status = "okay"; +}; diff --git a/boards/esp32s3_devkitm_esp32s3_procpu.conf b/boards/esp32s3_devkitm_esp32s3_procpu.conf deleted file mode 100644 index e69de29..0000000 diff --git a/prj.conf b/prj.conf index f8557ea..cd23a56 100644 --- a/prj.conf +++ b/prj.conf @@ -91,9 +91,6 @@ CONFIG_SYS_HEAP_RUNTIME_STATS=y CONFIG_SHELL_STACK_SIZE=4096 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 -# hwinfo is used for a unique device id -CONFIG_HWINFO=y - CONFIG_ASSERT=y # Enable MCUboot diff --git a/sample.yaml b/sample.yaml index 6687d33..e873dd4 100644 --- a/sample.yaml +++ b/sample.yaml @@ -5,6 +5,7 @@ common: - esp32s3_devkitm/esp32s3/procpu - esp32s3_devkitc/esp32s3/procpu - esp32c3_devkitm + - esp32c6_devkitc/esp32c6/hpcore sample: description: Memfault Zephyr ESP32 Example name: zephyr-esp32-example diff --git a/src/main.c b/src/main.c index 5c941c2..613b80c 100644 --- a/src/main.c +++ b/src/main.c @@ -1,42 +1,28 @@ //! @file #include -#include #include #include #include "app_version.h" #include "memfault/components.h" +#include "memfault/ports/zephyr/core.h" #include "memfault/ports/zephyr/http.h" LOG_MODULE_REGISTER(mflt_app, LOG_LEVEL_DBG); -const char *memfault_zephyr_get_device_id(void) { - uint8_t dev_id[16] = {0}; - static char dev_id_str[sizeof(dev_id) * 2 + 1]; +// This will be available in the memfault/ports/zephyr/core.h header in a later +// Memfault SDK release +extern const char* memfault_zephyr_get_device_id(void); - // Check if the device id has already been initialized - if (dev_id_str[0]) { - return dev_id_str; - } - - // Obtain the device id - ssize_t length = hwinfo_get_device_id(dev_id, sizeof(dev_id)); - - // Render the obtained serial number in hexadecimal representation - for (size_t i = 0; i < length; i++) { - (void)snprintf(&dev_id_str[i * 2], sizeof(dev_id_str), "%02x", dev_id[i]); - } - - return dev_id_str; -} - -void memfault_platform_get_device_info(sMemfaultDeviceInfo *info) { +void memfault_platform_get_device_info(sMemfaultDeviceInfo* info) { + // override the software version only to demonstrate inserting the GIT SHA *info = (sMemfaultDeviceInfo){ .device_serial = memfault_zephyr_get_device_id(), - .software_type = "app", - .software_version = APP_VERSION_STRING "+" ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1, - .hardware_version = CONFIG_BOARD, + .software_type = CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_TYPE, + .software_version = + CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_VERSION "+" ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1, + .hardware_version = CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_HARDWARE_VERSION, }; } diff --git a/west.yml b/west.yml index db4ebf8..f87e214 100644 --- a/west.yml +++ b/west.yml @@ -2,7 +2,7 @@ manifest: projects: - name: zephyr url: https://github.com/zephyrproject-rtos/zephyr - revision: v4.2.0 + revision: v4.3.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.28.0 + revision: 1.30.3