Skip to content

Commit e59fd95

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.27.0 (Build 14706)
1 parent b99f8c2 commit e59fd95

File tree

21 files changed

+632
-39
lines changed

21 files changed

+632
-39
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,79 @@ 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.27.0] - 2025-07-21
10+
11+
### 📈 Added
12+
13+
- General:
14+
15+
- Add a reference software watchdog port for the STM32L4 series LPTIM
16+
peripheral. Users of the STM32 HAL can now compile in the reference port and
17+
the `MemfaultWatchdog_Handler`. The handler will save a coredump so the full
18+
system state can be recovered when a watchdog takes place. More details can
19+
be found in
20+
[`ports/include/memfault/ports/watchdog.h`](ports/include/memfault/ports/watchdog.h).
21+
22+
- Add CLI commands `wdg_enable`, `wdg_disable`, and `wdog_update <timeout_ms>`
23+
for testing a software watchdog port. These commands are disabled by default
24+
and can be enabled for platforms using the minimal shell/console with
25+
`MEMFAULT_DEMO_CLI_WATCHDOG`.
26+
27+
- Zephyr:
28+
29+
- Add a new Kconfig option, `CONFIG_MEMFAULT_HTTP_MAX_MESSAGES_TO_SEND`, which
30+
controls the max number of messages that will be sent in a single invocation
31+
of `memfault_zephyr_port_post_data()` or similar APIs. The default is `100`,
32+
which is suitable for most applications. Before this change, the limit was
33+
hard coded to 5 messages, which was too low for systems with infrequent
34+
upload intervals.
35+
36+
- Support building for `native_sim` on arm64 hosts (specifically, the
37+
`native_sim/native/64` target), in addition to x86 hosts.
38+
39+
### 🛠️ Changed
40+
41+
- Zephyr:
42+
43+
- Improve the default implementation of
44+
`memfault_platform_sanitize_address_range()` to include all memory
45+
accessible by the kernel. This enables collection of heap-allocated task
46+
control blocks, which was previously unsupported. Users with discontiguous
47+
memory regions should provide their own implementation, as before.
48+
49+
- Prioritize the thread bookkeeping array when collecting thread information
50+
in a coredump (when `CONFIG_MEMFAULT_COREDUMP_COLLECT_TASKS_REGIONS=y`, the
51+
default). This improves the quality of the processed coredump if the
52+
coredump region is too small to collect all stacks for all threads in the
53+
system (impacts systems with many threads and limited coredump storage
54+
space).
55+
56+
- Add a new Kconfig option, `CONFIG_MEMFAULT_HTTP_PACKETIZER_BUFFER_SIZE`,
57+
which controls the size of the intermediate buffer used when reading data
58+
from the underlying data source (coredump storage, log buffer, CDR, etc)
59+
when uploading data to Memfault via HTTP. The default size is 128 bytes, and
60+
1024 bytes on nRF91x series SOCs to better support modem trace CDR upload.
61+
Thanks to @DematteisGiacomo for submitting this in
62+
[#92](https://github.com/memfault/memfault-firmware-sdk/pull/92).
63+
64+
- ESP-IDF:
65+
66+
- Handle deprecated Deep Sleep API calls for upcoming ESP-IDF v5.5 and v6.
67+
68+
- Supporting building with the Memfault CLI commands disabled,
69+
`CONFIG_MEMFAULT_CLI_ENABLED=n`. Thanks to @finger563 for reporting this
70+
issue and providing a fix in
71+
[#93](https://github.com/memfault/memfault-firmware-sdk/issues/93) 🎉!
72+
73+
### 🐛 Fixed
74+
75+
- Zephyr:
76+
77+
- Fix an issue where the socket file descriptor can potentially be leaked when
78+
the connection terminated unexpectedly during an HTTP chunk upload. Thanks
79+
to @DematteisGiacomo for submitting this in
80+
[#92](https://github.com/memfault/memfault-firmware-sdk/pull/92).
81+
982
## [1.26.1] - 2025-06-30
1083

1184
This is a minor fix release, addressing one future compatibility issue with the

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 14472
2-
GIT COMMIT: 5c095a2bce
3-
VERSION: 1.26.1
1+
BUILD ID: 14706
2+
GIT COMMIT: d002984f03
3+
VERSION: 1.27.0

components/demo/src/memfault_demo_shell_commands.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ static const sMemfaultShellCommand s_memfault_shell_commands[] = {
135135
"Run a self test to check integration with the SDK" },
136136
#endif
137137

138+
#if MEMFAULT_DEMO_CLI_WATCHDOG
139+
{ "wdog_enable", memfault_demo_cli_cmd_software_watchdog_enable, "Enable the software watchdog" },
140+
{ "wdog_disable", memfault_demo_cli_cmd_software_watchdog_disable,
141+
"Disable the software watchdog" },
142+
{ "wdog_update", memfault_demo_cli_cmd_software_watchdog_update_timeout,
143+
"Update the software watchdog timeout" },
144+
#endif
145+
138146
{ "help", memfault_shell_help_handler, "Lists all commands" },
139147
};
140148

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//! @file
2+
//!
3+
//! Copyright (c) Memfault, Inc.
4+
//! See LICENSE for details
5+
//!
6+
//! @brief
7+
//! CLI commands used by demo applications to exercise the Memfault software watchdog
8+
9+
#include "memfault/config.h"
10+
11+
#if MEMFAULT_DEMO_CLI_WATCHDOG
12+
13+
#include <stdlib.h>
14+
15+
#include "memfault/core/compiler.h"
16+
#include "memfault/core/debug_log.h"
17+
#include "memfault/ports/watchdog.h"
18+
19+
int memfault_demo_cli_cmd_software_watchdog_enable(MEMFAULT_UNUSED int argc,
20+
MEMFAULT_UNUSED char *argv[]) {
21+
int rv = memfault_software_watchdog_enable();
22+
if (rv < 0) {
23+
MEMFAULT_LOG_RAW("Failed to enable software watchdog: %d", rv);
24+
return -1;
25+
}
26+
return 0;
27+
}
28+
29+
int memfault_demo_cli_cmd_software_watchdog_disable(MEMFAULT_UNUSED int argc,
30+
MEMFAULT_UNUSED char *argv[]) {
31+
int rv = memfault_software_watchdog_disable();
32+
if (rv < 0) {
33+
MEMFAULT_LOG_RAW("Failed to disable software watchdog: %d", rv);
34+
return -1;
35+
}
36+
return 0;
37+
}
38+
39+
int memfault_demo_cli_cmd_software_watchdog_update_timeout(MEMFAULT_UNUSED int argc,
40+
MEMFAULT_UNUSED char *argv[]) {
41+
if (argc < 2) {
42+
MEMFAULT_LOG_RAW("Usage: wdog_update <timeout_ms>");
43+
return -1;
44+
}
45+
46+
int timeout_ms = atoi(argv[1]);
47+
if (timeout_ms <= 0) {
48+
MEMFAULT_LOG_RAW("Invalid timeout value: %d", timeout_ms);
49+
return -1;
50+
}
51+
52+
int rv = memfault_software_watchdog_update_timeout(timeout_ms);
53+
if (rv < 0) {
54+
MEMFAULT_LOG_RAW("Failed to update software watchdog timeout: %d", rv);
55+
return -1;
56+
}
57+
MEMFAULT_LOG_RAW("Software watchdog timeout updated to %d ms", timeout_ms);
58+
return 0;
59+
}
60+
61+
#endif // MEMFAULT_DEMO_CLI_WATCHDOG

components/include/memfault/default_config.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,15 @@ extern "C" {
600600
#define MEMFAULT_DEMO_CLI_SELF_TEST_COREDUMP_STORAGE 0
601601
#endif
602602

603+
//! Enable testing of the software watchdog through the Demo CLI component
604+
//!
605+
//! Setting this config to 1 will add new commands to enable, disable, and update the timeout
606+
//! of the software watchdog. To use this feature, a software watchdog implementation must be
607+
//! provided. See https://docs.memfault.com/docs/mcu/watchdogs for more details.
608+
#ifndef MEMFAULT_DEMO_CLI_WATCHDOG
609+
#define MEMFAULT_DEMO_CLI_WATCHDOG 0
610+
#endif
611+
603612
//
604613
// Custom Data Recording configuration options [EXPERIMENTAL]
605614
//

components/include/memfault/demo/cli.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ int memfault_demo_cli_cmd_heartbeat(int argc, char *argv[]);
127127
//! This command triggers a test which exercises different subsystems
128128
int memfault_demo_cli_cmd_self_test(int argc, char *argv[]);
129129

130+
//! Enable the software watchdog
131+
int memfault_demo_cli_cmd_software_watchdog_enable(int argc, char *argv[]);
132+
133+
//! Disable the software watchdog
134+
int memfault_demo_cli_cmd_software_watchdog_disable(int argc, char *argv[]);
135+
136+
//! Update the software watchdog timeout
137+
int memfault_demo_cli_cmd_software_watchdog_update_timeout(int argc, char *argv[]);
138+
130139
#ifdef __cplusplus
131140
}
132141
#endif

components/include/memfault/version.h

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

2222
#define MEMFAULT_SDK_VERSION \
23-
{ .major = 1, .minor = 26, .patch = 1 }
24-
#define MEMFAULT_SDK_VERSION_STR "1.26.1"
23+
{ .major = 1, .minor = 27, .patch = 0 }
24+
#define MEMFAULT_SDK_VERSION_STR "1.27.0"
2525

2626
#ifdef __cplusplus
2727
}

components/panics/src/memfault_fault_handling_aarch64.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#include "memfault/panics/coredump_impl.h"
1616
#include "memfault/panics/fault_handling.h"
1717

18+
//! Provide stub implementations here to support building only
19+
void memfault_platform_halt_if_debugging(void) { }
20+
bool memfault_arch_is_inside_isr(void) {
21+
return false;
22+
}
23+
1824
MEMFAULT_WEAK void memfault_platform_fault_handler(MEMFAULT_UNUSED const sMfltRegState *regs,
1925
MEMFAULT_UNUSED eMemfaultRebootReason reason) { }
2026

examples/zephyr/qemu/qemu-app/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ zephyr_compile_definitions(
3434
)
3535

3636
zephyr_compile_options(--param=min-pagesize=0x1000)
37+
38+
# For Zephyr >=3.0.0,<3.6.0, explicitly enable -Werror
39+
if (${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}.${KERNEL_PATCHLEVEL} VERSION_GREATER_EQUAL 3.0.0 AND
40+
${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}.${KERNEL_PATCHLEVEL} VERSION_LESS 3.6.0)
41+
zephyr_compile_options(-Werror)
42+
endif()

examples/zephyr/qemu/qemu-app/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ config ZEPHYR_MEMFAULT_EXAMPLE_SOFTWARE_VERSION
3131
help
3232
The software version to report to Memfault.
3333

34+
# Stub expressions, to support backwards compatibility with older Zephyr
35+
# versions where these options were not available.
36+
config COMPILER_WARNINGS_AS_ERRORS # v3.6.0+
37+
bool "Treat warnings as errors"
38+
39+
config CRC # v3.3.0+
40+
bool "Cyclic redundancy check (CRC) Support"
41+
42+
config BUILD_OUTPUT_META # v3.0.0+
43+
bool "Create a build meta file"
44+
3445
endmenu
3546

3647
source "Kconfig.zephyr"

0 commit comments

Comments
 (0)