Skip to content

Commit 03050f2

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.19.0 (Build 12144)
1 parent 0bd360f commit 03050f2

File tree

89 files changed

+2460
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2460
-180
lines changed

CHANGELOG.md

Lines changed: 212 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,217 @@ 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.19.0] - 2025-01-10
10+
11+
### 📈 Added
12+
13+
- General:
14+
15+
- Add an option to set the
16+
[Self Test component](https://docs.memfault.com/docs/mcu/self-test) output
17+
log level, `MEMFAULT_SELF_TEST_OUTPUT_LOG`, to control the verbosity of the
18+
Self Test output. Set it by selecting the Memfault Log macro to use, for
19+
example `#define MEMFAULT_SELF_TEST_OUTPUT_LOG MEMFAULT_LOG_DEBUG`. The
20+
default level is the same as before, `MEMFAULT_LOG_INFO`.
21+
22+
- Add an
23+
[implementation of `memfault_reboot_reason_get()`](ports/stm32cube/u5/rcc_reboot_tracking.c)
24+
for the STM32U5xx series of MCUs, using the `RCC-CSR` register to determine
25+
the reset reason. Add the file to your project to make use of it!
26+
27+
- Add an
28+
[implementation for flash-backed coredump storage](ports/stm32cube/u5/flash_coredump_storage.c)
29+
for the STM32U5xx series of MCUs, using the internal flash memory to store
30+
coredumps. Add the file to your project to make use of it!
31+
32+
- Enable the MPU (Memory Protection Unit) in the
33+
[FreeRTOS QEMU example](examples/freertos/), to demonstrate Memfault's
34+
[MPU region analysis feature](https://docs.memfault.com/docs/platform/trace-details#mpu-analysis).
35+
This feature is enabled in a Memfault project by setting
36+
`#define MEMFAULT_COLLECT_MPU_STATE 1` in `memfault_platform_config.h`. The
37+
MPU registers are captured as part of a coredump, and Memfault will analyze
38+
the configuration and include the result in the Trace viewer.
39+
40+
- Add a new reboot reason code, `kMfltRebootReason_TaskWatchdog`, for marking
41+
crashes due to a Task Watchdog. Memfault has a
42+
[built-in Task Watchdog system](https://github.com/memfault/memfault-firmware-sdk/blob/master/components/include/memfault/core/task_watchdog.h),
43+
and
44+
[Zephyr](https://docs.zephyrproject.org/latest/services/task_wdt/index.html)
45+
and
46+
[ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/wdts.html#task-watchdog-timer-twdt)
47+
both implement Task Watchdog systems.
48+
49+
- FreeRTOS:
50+
51+
- Add support for tracking per-thread stack usage in the
52+
[Memfault FreeRTOS port](ports/freertos/src/memfault_sdk_metrics_thread.c).
53+
This feature is enabled by default and can be disabled by setting
54+
`#define MEMFAULT_FREERTOS_COLLECT_THREAD_METRICS 0` in
55+
`memfault_platform_config.h`. The default threads monitored are `IDLE` and
56+
`Tmr Svc`.
57+
58+
Threads are registered for tracking by defining
59+
`MEMFAULT_METRICS_DEFINE_THREAD_METRICS()` in the application. For example:
60+
61+
```c
62+
//! Set the list of threads to monitor for stack usage. The metric keys must
63+
//! be defined in memfault_metrics_heartbeat_config.def, ex:
64+
//!
65+
//! MEMFAULT_METRICS_KEY_DEFINE_WITH_SCALE_VALUE(
66+
//! memory_main_pct_max, kMemfaultMetricType_Unsigned,
67+
//! CONFIG_MEMFAULT_METRICS_THREADS_MEMORY_SCALE_FACTOR
68+
//! )
69+
#include "memfault/ports/zephyr/thread_metrics.h"
70+
MEMFAULT_METRICS_DEFINE_THREAD_METRICS (
71+
// monitor the main thread stack usage
72+
{
73+
.thread_name = "main",
74+
.stack_usage_metric_key = MEMFAULT_METRICS_KEY(memory_main_pct_max),
75+
},
76+
// monitor the shell_uart thread stack usage
77+
{
78+
.thread_name = "shell_uart",
79+
.stack_usage_metric_key = MEMFAULT_METRICS_KEY(memory_shell_uart_pct_max),
80+
});
81+
```
82+
83+
- Add example usage of per-thread stack usage support to the
84+
[FreeRTOS QEMU example](examples/freertos/) for the idle, timer service,
85+
console input, metrics, and heap tasks.
86+
87+
- Add tracking of libc heap usage via the `memory_pct_max` metric to the
88+
[FreeRTOS QEMU example](examples/freertos/)
89+
90+
- Zephyr:
91+
92+
- Add support for tracking per-thread stack usage in the
93+
[Memfault Zephyr port](ports/zephyr/common/memfault_platform_metrics.c).
94+
This feature is enabled by default and can be disabled by setting
95+
`CONFIG_MEMFAULT_METRICS_THREADS=n`. The default threads monitored are
96+
`main` and `sysworkq`.
97+
98+
Threads are registered for tracking by defining
99+
`MEMFAULT_METRICS_DEFINE_THREAD_METRICS()` in the application. For example:
100+
101+
```c
102+
//! Set the list of threads to monitor for stack usage. The metric keys must
103+
//! be defined in memfault_metrics_heartbeat_config.def, ex:
104+
//!
105+
//! MEMFAULT_METRICS_KEY_DEFINE_WITH_SCALE_VALUE(
106+
//! memory_main_pct_max, kMemfaultMetricType_Unsigned,
107+
//! CONFIG_MEMFAULT_METRICS_THREADS_MEMORY_SCALE_FACTOR
108+
//! )
109+
#include "memfault/ports/zephyr/thread_metrics.h"
110+
MEMFAULT_METRICS_DEFINE_THREAD_METRICS (
111+
{
112+
.thread_name = "main",
113+
.stack_usage_metric_key = MEMFAULT_METRICS_KEY(memory_main_pct_max),
114+
},
115+
{
116+
.thread_name = "shell_uart",
117+
.stack_usage_metric_key = MEMFAULT_METRICS_KEY(memory_shell_uart_pct_max),
118+
});
119+
```
120+
121+
- Update to support removal of the global `CSTD` compiler property (deprecated
122+
in Zephyr v3.7.0, and just removed in Zephyr `main`), when
123+
`CONFIG_MEMFAULT_COMPACT_LOG` is enabled. Thanks to
124+
[@fouge](https://github.com/fouge) for providing this fix in
125+
[#78](https://github.com/memfault/memfault-firmware-sdk/pull/78) !
126+
127+
- Add a new built-in metric, `cpu_usage_pct`, which reports the percentage of
128+
the CPU used. This metric is enabled by default as part of the default set
129+
of metrics, controlled with `CONFIG_MEMFAULT_METRICS_DEFAULT_SET_ENABLE`.
130+
131+
- For ARM targets implementing and enabling the MPU, automatically capture the
132+
and
133+
[analyze the MPU configuration](https://docs.memfault.com/docs/platform/trace-details#mpu-analysis)
134+
as part of a coredump. This can be controlled with the
135+
`CONFIG_MEMFAULT_COREDUMP_COLLECT_MPU_STATE` Kconfig option.
136+
137+
- Add a new Kconfig option, `CONFIG_MEMFAULT_METRICS_HEARTBEAT_INTERVAL_SECS`,
138+
which should be used instead of
139+
`#define MEMFAULT_METRICS_HEARTBEAT_INTERVAL_SECS xxx` in
140+
`memfault_platform_config.h`. A build error will occur if the value is set
141+
in `memfault_platform_config.h` to enforce migrating the setting. Thanks to
142+
[@JordanYates](https://github.com/JordanYates) for reporting this feature
143+
request in
144+
[#80](https://github.com/memfault/memfault-firmware-sdk/issues/80)
145+
146+
- ESP-IDF:
147+
148+
- Add support for correctly marking crashes triggered due to a Task Watchdog.
149+
A test command, `esp_task_watchdog <cpuid>`, has been added to the
150+
[esp32 sample app](examples/esp32) to trigger a Task Watchdog fault on the
151+
specified core. Be sure to enable the Kconfig option
152+
`CONFIG_ESP_TASK_WDT_PANIC=y` to have the system panic when a Task Watchdog
153+
fault occurs. Memfault will capture and tag the fault appropriately, as for
154+
other fault types.
155+
156+
- Add a new Kconfig option, `CONFIG_MEMFAULT_METRICS_HEARTBEAT_INTERVAL_SECS`,
157+
which should be used instead of
158+
`#define MEMFAULT_METRICS_HEARTBEAT_INTERVAL_SECS xxx` in
159+
`memfault_platform_config.h`. A build error will occur if the value is set
160+
in `memfault_platform_config.h` to enforce migrating the setting.
161+
162+
- nRF-Connect SDK:
163+
164+
- Add an implementation for reboot reason tracking on the nRF54Lx series of
165+
MCUs, using the `RESETREAS` register to determine the reset reason. This
166+
will be automatically enabled when building for an nRF54Lx series device
167+
(`CONFIG_SOC_SERIES_NRF54LX=y`).
168+
169+
- Add example usage of per-thread stack usage support to the
170+
[nRF9160 example](examples/nrf-connect-sdk/nrf9160) for the idle, sysworkq,
171+
mflt http, WDT, and shell uart tasks.
172+
173+
### 🐛 Fixed
174+
175+
- Zephyr:
176+
177+
- Fix the `MEMFAULT_METRICS_CPU_TEMP` Kconfig dependencies, to correctly check
178+
for presence of the DT `die-temp0` alias, and remove the dependency on
179+
`ADC`, which doesn't apply to all boards implementing a temp sensor. Thanks
180+
to [@JordanYates](https://github.com/JordanYates) for reporting this issue
181+
in [#79](https://github.com/memfault/memfault-firmware-sdk/issues/79) !
182+
183+
### 🛠️ Changed
184+
185+
- General:
186+
187+
- The [`eclipse_patch.py`](scripts/eclipse_patch.py) utility
188+
`--memfault-sdk-dir` argument is now optional, and defaults to the parent
189+
directory of the script folder.
190+
191+
- FreeRTOS:
192+
193+
- Renamed the [FreeRTOS QEMU sample app](examples/freertos) heap metrics from
194+
`Example_HeapFreeBytes` and `Example_HeapMinFreeBytes` to
195+
`FreeRTOS_HeapFreeBytes` and `FreeRTOS_HeapMinFreeBytes`.
196+
197+
- nRF-Connect SDK:
198+
199+
- Update the [nRF91 sample app](examples/nrf-connect-sdk/nrf91) to only enable
200+
the UART log backend. Previously both the SHELL and UART log backends were
201+
enabled, resulting in duplicate log lines emitted to the console.
202+
203+
- Update the [nRF91 sample app](examples/nrf-connect-sdk/nrf91) and the
204+
[nRF5x sample app](examples/nrf-connect-sdk/nrf5) to use the latest version
205+
of the nRF-Connect SDK, v2.9.0.
206+
207+
- Zephyr:
208+
209+
- Renamed the [QEMU sample app](examples/zephyr/qemu/) metric
210+
`main_thread_cpu_time_permille` -> `cpu_usage_main_pct`.
211+
9212
## [1.18.0] - 2024-11-25
10213

11214
### 📈 Added
12215

13216
- General:
14217

15218
- Add a new built-in metric, `uptime_s`, which reports the total uptime of the
16-
device in seconds. This metrics is enabled by default, and can be disabled
219+
device in seconds. This metric is enabled by default, and can be disabled
17220
with `#define MEMFAULT_METRICS_UPTIME_ENABLE 0` in
18221
`memfault_platform_config.h`.
19222

@@ -31,6 +234,14 @@ and this project adheres to
31234
capture the core that triggered the fault, and if the non-faulting core is
32235
available for capture, it will be included as well.
33236

237+
### 🛠️ Changed
238+
239+
- ESP-IDF:
240+
241+
- Updated the [ESP32 example](examples/esp32) to no longer read some
242+
non-volatile values into stack-allocated buffers. This reduces overall stack
243+
usage for the `main` thread by about 350 bytes.
244+
34245
## [1.17.0] - 2024-11-14
35246

36247
### 📈 Added

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 11548
2-
GIT COMMIT: 045729d525
3-
VERSION: 1.18.0
1+
BUILD ID: 12144
2+
GIT COMMIT: 24d5bb4ea2
3+
VERSION: 1.19.0

0 commit comments

Comments
 (0)