Skip to content
Merged
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
13 changes: 13 additions & 0 deletions boards/esp32c6_devkitc_esp32c6_hpcore.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};

&coretemp {
status = "okay";
};
Empty file.
3 changes: 0 additions & 3 deletions prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 10 additions & 24 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,42 +1,28 @@
//! @file

#include <string.h>
#include <zephyr/drivers/hwinfo.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>

#include "app_version.h"
#include "memfault/components.h"
#include "memfault/ports/zephyr/core.h"
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header memfault/ports/zephyr/core.h is included but according to the comment on lines 14-15, the function memfault_zephyr_get_device_id() is not yet available in this header in the current SDK version. Since the Memfault SDK is being updated to 1.30.3, verify that this function is actually exported in that version's header. If not, the include may need to wait until a later SDK version, or the extern declaration is correct but the comment should clarify the current SDK version doesn't export it yet.

Copilot uses AI. Check for mistakes.
#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,
};
}

Expand Down
4 changes: 2 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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