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