Skip to content

Commit 12832aa

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.7.3 (Build 6923)
1 parent dae1917 commit 12832aa

File tree

18 files changed

+208
-38
lines changed

18 files changed

+208
-38
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.7.3] - 2024-03-19
10+
11+
### :chart_with_upwards_trend: Improvements
12+
13+
- Zephyr:
14+
15+
- Add new Kconfig flags for the following Memfault Core Metrics:
16+
17+
- `MEMFAULT_METRICS_SYNC_SUCCESS` (default=y)
18+
- `MEMFAULT_METRICS_MEMFAULT_SYNC_SUCCESS` (default=y)
19+
- `MEMFAULT_METRICS_CONNECTIVITY_CONNECTED_TIME` (default=y)
20+
- `MEMFAULT_METRICS_BATTERY_ENABLE` (default=n)
21+
22+
Additionally, a Kconfig flag `MEMFAULT_BATTERY_METRICS_BOOT_ON_SYSTEM_INIT`
23+
will enable auto-initialization of battery metrics on system init (requires
24+
`memfault_platform_get_stateofcharge()` to be implemented).
25+
26+
See https://mflt.io/core-metrics for more information on Core Metrics.
27+
28+
- ESP-IDF:
29+
30+
- Add preliminary support for the upcoming ESP-IDF v5.3.0 release.
31+
932
## [1.7.2] - 2024-03-09
1033

1134
### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 6714
2-
GIT COMMIT: 1d29e68571
3-
VERSION: 1.7.2
1+
BUILD ID: 6923
2+
GIT COMMIT: 47bd79f60f
3+
VERSION: 1.7.3

components/include/memfault/http/http_client.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ typedef struct MfltHttpClientConfig {
4646
//! Route used to get information from the Memfault cloud pertaining to a device in your fleet.
4747
//! For example, the latest firmware release available.
4848
sMemfaultHttpApi device_api;
49-
//! Callback for fetching device info for the OTA'ing device. Typically this callback can be left
50-
//! unset, but if the request is on behalf of a downstream device, can be substituted with the
51-
//! downstream device's information. The function signature is the same as
52-
//! memfault_platform_get_device_info(). If NULL, memfault_platform_get_device_info() will be
53-
//! used.
49+
//! Callback for fetching device info, used when uploading chunks and
50+
//! performing OTA checks. Typically this callback can be left unset, but if
51+
//! the request is on behalf of a downstream device, can be substituted with
52+
//! the downstream device's information. The function signature is the same as
53+
//! memfault_platform_get_device_info(). If unset (the default),
54+
//! memfault_platform_get_device_info() will be used.
5455
void (*get_device_info)(sMemfaultDeviceInfo *info);
5556
} sMfltHttpClientConfig;
5657

components/include/memfault/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ typedef struct {
1919
uint8_t patch;
2020
} sMfltSdkVersion;
2121

22-
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 7, .patch = 2 }
23-
#define MEMFAULT_SDK_VERSION_STR "1.7.2"
22+
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 7, .patch = 3 }
23+
#define MEMFAULT_SDK_VERSION_STR "1.7.3"
2424

2525
#ifdef __cplusplus
2626
}

components/panics/src/memfault_coredump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
//!
66
//! @brief
77
//! Logic for saving a coredump to backing storage and reading it out
8+
//!
9+
//! See https://mflt.io/mcu-coredump-format for a tabular view of the
10+
//! Memfault coredump format
811

912
#include <stdbool.h>
1013
#include <string.h>

examples/esp32/apps/memfault_demo_app/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ include(${memfault_firmare_sdk_dir}/ports/esp_idf/memfault.cmake)
2929
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
3030
project(${PROJECT_NAME})
3131

32+
# Enable a compilation error if any deprecated APIs are used. This helps detect
33+
# bleeding edge changes in the ESP-IDF.
34+
if (IDF_VERSION_MAJOR VERSION_GREATER_EQUAL 5)
35+
idf_build_set_property(COMPILE_OPTIONS "-Werror=deprecated-declarations" APPEND)
36+
endif()
37+
3238
# Check for invalid partition table configurations
3339
if (
3440
CONFIG_APP_MEMFAULT_TRANSPORT_HTTP AND

examples/esp32/apps/memfault_demo_app/main/main.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include "nvs_flash.h"
3636
#include "settings.h"
3737

38+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
39+
#include "driver/uart_vfs.h"
40+
#endif
41+
3842
// Conditionally enable the logging tag variable only when it's used
3943
#if defined(CONFIG_STORE_HISTORY) || defined(CONFIG_HEAP_USE_HOOKS)
4044
static const char *TAG = "main";
@@ -86,7 +90,13 @@ static void initialize_console() {
8690
setvbuf(stdin, NULL, _IONBF, 0);
8791
setvbuf(stdout, NULL, _IONBF, 0);
8892

89-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
93+
// These APIs vary depending on ESP-IDF version.
94+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
95+
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
96+
uart_vfs_dev_port_set_rx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CR);
97+
/* Move the caret to the beginning of the next line on '\n' */
98+
uart_vfs_dev_port_set_tx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CRLF);
99+
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
90100
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
91101
esp_vfs_dev_uart_port_set_rx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CR);
92102
/* Move the caret to the beginning of the next line on '\n' */
@@ -102,7 +112,11 @@ static void initialize_console() {
102112
ESP_ERROR_CHECK(uart_driver_install(CONFIG_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0));
103113

104114
/* Tell VFS to use UART driver */
115+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
116+
uart_vfs_dev_use_driver(CONFIG_CONSOLE_UART_NUM);
117+
#else
105118
esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM);
119+
#endif
106120

107121
/* Initialize the console */
108122
esp_console_config_t console_config = {
@@ -173,7 +187,7 @@ static void prv_memfault_ota(void) {
173187

174188
int rv = memfault_esp_port_ota_update(&handler);
175189

176-
#if MEMFAULT_METRICS_SYNC_SUCCESS
190+
#if defined(CONFIG_MEMFAULT_METRICS_SYNC_SUCCESS)
177191
// Record the OTA check result using the built-in sync success metric
178192
if (rv == 0 || rv == 1) {
179193
memfault_metrics_connectivity_record_sync_success();

examples/esp32/apps/memfault_demo_app/main/memfault/memfault_platform_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@
99
//! Default configuration settings can be found in "memfault/config.h"
1010

1111
#define MEMFAULT_TASK_WATCHDOG_ENABLE 1
12-
13-
// Enable the sync_successful metric
14-
#define MEMFAULT_METRICS_SYNC_SUCCESS 1

ports/esp_idf/memfault/CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,22 @@ endif()
257257
# FreeRTOS task list is walked server side instead of on device (so you can get crash data even if the lists are corrupted)
258258
# Much more flexibility in debug information collected (e.g. all RAM, just the current stack trace, select stacks and variables)
259259
# Data can be posted directly from device to Memfault cloud for deduplication and analysis
260-
target_link_libraries(${this_component} INTERFACE "-Wl,--wrap=esp_core_dump_to_flash -Wl,--wrap=esp_core_dump_init -Wl,--wrap=esp_core_dump_image_get")
260+
#
261+
# Note: in ESP-IDF v5.3.0, the core dump handler function was renamed from esp_core_dump_to_flash to esp_core_dump_write
262+
set(panic_handler_args "")
263+
if (DEFINED ENV{IDF_VERSION})
264+
if ($ENV{IDF_VERSION} VERSION_GREATER_EQUAL "5.3.0")
265+
list(APPEND panic_handler_args "-Wl,--wrap=esp_core_dump_write")
266+
else()
267+
list(APPEND panic_handler_args "-Wl,--wrap=esp_core_dump_to_flash")
268+
endif()
269+
endif()
270+
list(
271+
APPEND panic_handler_args
272+
"-Wl,--wrap=esp_core_dump_init"
273+
"-Wl,--wrap=esp_core_dump_image_get"
274+
)
275+
target_link_libraries(${this_component} INTERFACE "${panic_handler_args}")
261276

262277
# Wrap panic_abort to intercept assert()/abort() calls. Note that support for
263278
# this was added in ESP-IDF v4.2; earlier versions are intercepted with the

ports/esp_idf/memfault/Kconfig

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,34 @@ endif
174174
help
175175
Collects Memfault metrics for basic heap utilization.
176176

177-
config MEMFAULT_SYNC_MEMFAULT_METRICS
178-
bool "Enable sync_memfault_successful metric"
179-
default y
180-
help
181-
Collects Memfault metrics for the number of successful and failed
182-
syncs to the Memfault cloud.
177+
config MEMFAULT_METRICS_SYNC_SUCCESS
178+
bool "Enable collection of sync success metrics"
179+
default y
180+
help
181+
Memfault user-defined sync success metric component. More information
182+
at https://mflt.io/core-metrics .
183+
184+
config MEMFAULT_METRICS_MEMFAULT_SYNC_SUCCESS
185+
bool "Enable collection of memfault sync success metrics"
186+
default y
187+
help
188+
Collects Memfault metrics for the number of successful and failed
189+
syncs to the Memfault cloud. More information at
190+
https://mflt.io/core-metrics .
191+
192+
config MEMFAULT_METRICS_CONNECTIVITY_CONNECTED_TIME
193+
bool "Enable collection of memfault connectivity time metrics"
194+
default y
195+
help
196+
Memfault connectivity time metric component. More information at
197+
https://mflt.io/core-metrics .
198+
199+
config MEMFAULT_METRICS_BATTERY_ENABLE
200+
bool "Enable collection of battery metrics"
201+
default n
202+
help
203+
Memfault battery metric component. More information at
204+
https://mflt.io/core-metrics .
183205

184206
config MEMFAULT_ASSERT_ON_ALLOC_FAILURE
185207
bool "Assert on allocation failure"

0 commit comments

Comments
 (0)