Skip to content

Commit ed13d50

Browse files
authored
Update Memfault SDK to 1.30.3 and Zephyr to 4.3.0 (#20)
Add esp32c6 board. ```bash uart:~$ wifi connect -k 1 -s <ssid> -p <pw> Connection requested [00:00:20.404,000] <inf> net_dhcpv4: Received: 192.168.1.170 Connected uart:~$ mflt post_chunks [00:00:23.828,000] <inf> mflt: Posting Memfault Data [00:00:23.829,000] <dbg> mflt: memfault_platform_log: Opening socket to chunks.memfault.com:443 [00:00:23.876,000] <dbg> mflt: memfault_platform_log: DNS lookup for chunks.memfault.com = 98.90.183.58 [00:00:24.303,000] <dbg> mflt: memfault_platform_log: Response Complete: Parse Status 0 HTTP Status 202! [00:00:24.304,000] <dbg> mflt: memfault_platform_log: Body: Accepted [00:00:24.309,000] <dbg> mflt: memfault_platform_log: No more data to send [00:00:24.320,000] <inf> mflt: Data posted successfully, 62 bytes sent ```
1 parent 2f934d3 commit ed13d50

File tree

6 files changed

+26
-29
lines changed

6 files changed

+26
-29
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&wifi {
8+
status = "okay";
9+
};
10+
11+
&coretemp {
12+
status = "okay";
13+
};

boards/esp32s3_devkitm_esp32s3_procpu.conf

Whitespace-only changes.

prj.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ CONFIG_SYS_HEAP_RUNTIME_STATS=y
9191
CONFIG_SHELL_STACK_SIZE=4096
9292
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
9393

94-
# hwinfo is used for a unique device id
95-
CONFIG_HWINFO=y
96-
9794
CONFIG_ASSERT=y
9895

9996
# Enable MCUboot

sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ common:
55
- esp32s3_devkitm/esp32s3/procpu
66
- esp32s3_devkitc/esp32s3/procpu
77
- esp32c3_devkitm
8+
- esp32c6_devkitc/esp32c6/hpcore
89
sample:
910
description: Memfault Zephyr ESP32 Example
1011
name: zephyr-esp32-example

src/main.c

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,28 @@
11
//! @file
22

33
#include <string.h>
4-
#include <zephyr/drivers/hwinfo.h>
54
#include <zephyr/kernel.h>
65
#include <zephyr/logging/log.h>
76

87
#include "app_version.h"
98
#include "memfault/components.h"
9+
#include "memfault/ports/zephyr/core.h"
1010
#include "memfault/ports/zephyr/http.h"
1111

1212
LOG_MODULE_REGISTER(mflt_app, LOG_LEVEL_DBG);
1313

14-
const char *memfault_zephyr_get_device_id(void) {
15-
uint8_t dev_id[16] = {0};
16-
static char dev_id_str[sizeof(dev_id) * 2 + 1];
14+
// This will be available in the memfault/ports/zephyr/core.h header in a later
15+
// Memfault SDK release
16+
extern const char* memfault_zephyr_get_device_id(void);
1717

18-
// Check if the device id has already been initialized
19-
if (dev_id_str[0]) {
20-
return dev_id_str;
21-
}
22-
23-
// Obtain the device id
24-
ssize_t length = hwinfo_get_device_id(dev_id, sizeof(dev_id));
25-
26-
// Render the obtained serial number in hexadecimal representation
27-
for (size_t i = 0; i < length; i++) {
28-
(void)snprintf(&dev_id_str[i * 2], sizeof(dev_id_str), "%02x", dev_id[i]);
29-
}
30-
31-
return dev_id_str;
32-
}
33-
34-
void memfault_platform_get_device_info(sMemfaultDeviceInfo *info) {
18+
void memfault_platform_get_device_info(sMemfaultDeviceInfo* info) {
19+
// override the software version only to demonstrate inserting the GIT SHA
3520
*info = (sMemfaultDeviceInfo){
3621
.device_serial = memfault_zephyr_get_device_id(),
37-
.software_type = "app",
38-
.software_version = APP_VERSION_STRING "+" ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1,
39-
.hardware_version = CONFIG_BOARD,
22+
.software_type = CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_TYPE,
23+
.software_version =
24+
CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_VERSION "+" ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1,
25+
.hardware_version = CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_HARDWARE_VERSION,
4026
};
4127
}
4228

west.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ manifest:
22
projects:
33
- name: zephyr
44
url: https://github.com/zephyrproject-rtos/zephyr
5-
revision: v4.2.0
5+
revision: v4.3.0
66
import:
77
# Limit the Zephyr modules to the required set
88
name-allowlist:
@@ -13,4 +13,4 @@ manifest:
1313
- name: memfault-firmware-sdk
1414
url: https://github.com/memfault/memfault-firmware-sdk
1515
path: modules/lib/memfault-firmware-sdk
16-
revision: 1.28.0
16+
revision: 1.30.3

0 commit comments

Comments
 (0)