Releases: memfault/memfault-firmware-sdk
1.30.1
This is a patch release, fixing one bug and applying a minor code quality
improvement to the Python tooling files.
🐛 Fixed
-
nRF-Connect SDK:
- Fixed an issue where panic logs generated from ISRs caused a double fault
for Nordic nRF91 users whereCONFIG_LOG_MODE_IMMEDIATE=n
and
MEMFAULT_LOG_TIMESTAMPS_ENABLE
is 1.
- Fixed an issue where panic logs generated from ISRs caused a double fault
-
General:
- Added Python type annotations to the files in the
tasks
directory.
- Added Python type annotations to the files in the
1.30.0
This is a minor release. Highlights:
- Added active task stack collection control in Zephyr
- Changed mount point selection for filesystem metric to look up from Zephyr
device tree fstab entries - Fixed potential WiFi stack overflow on nRF70 series devices during HTTP
uploads
📈 Added
-
Zephyr
-
Add Kconfig option
CONFIG_MEMFAULT_COREDUMP_ACTIVE_TASK_STACK_SIZE_TO_COLLECT
to control how
much of the active task stack is collected in coredumps. This can be used to
prioritize capturing details about the running task when coredump storage
space is limited. Defaults to
CONFIG_MEMFAULT_COREDUMP_STACK_SIZE_TO_COLLECT
for backwards
compatibility. -
Add the
mflt_http
workqueue thread to the default set of threads tracked
with max stack usage metrics. The default thread metrics can be controlled
withCONFIG_MEMFAULT_METRICS_THREADS_DEFAULTS
.
-
🛠️ Changed
-
Zephyr
-
Replace use of deprecated API
bt_hci_cmd_create()
with
bt_hci_cmd_alloc()
for Zephyr 4.2+. -
Enable
FileSystem_BytesFree
metric by default only when fstab is present
in the device tree. If present, the mount point is now automatically
detected from checking fstab nodes. Manual configuration of the mount point
viaCONFIG_MEMFAULT_FS_BYTES_FREE_VFS_PATH
still takes precedence when
set. If not using fstab, setCONFIG_MEMFAULT_FS_BYTES_FREE_METRIC=y
to
enable collection.
-
🐛 Fixed
-
nRF-Connect SDK:
1.29.0
This is a minor release. Highlights:
- Added 9 new built-in metrics for BLE devices for Zephyr projects 🎉
- Added a session metrics API to deactivate a session
- Fixed a bug where thread state was missing from small coredumps in ESP-IDF
📈 Added
-
General:
- Add a new Session Metric API:
MEMFAULT_METRICS_SESSION_RESET()
, which can
be used to deactivate an active session instead of ending it with
MEMFAULT_METRICS_SESSION_END()
. This will discard the metrics in the
specified session.
- Add a new Session Metric API:
-
nRF-Connect SDK:
-
Added an implementation for storing coredumps in RRAM, for SOCs that support
it (nRF54L series for example). Enable with
CONFIG_MEMFAULT_COREDUMP_STORAGE_RRAM=y
. Requires a partition manager
entry namedmemfault_coredump_partition
. -
Also added a coredump storage implementation for MRAM, specifically
targeting the nRF54H series of devices. Enable with
CONFIG_MEMFAULT_COREDUMP_STORAGE_MRAM=y
. Requires adding a fixed partition
entry namedmemfault_coredump_partition
, for example via a devicetree
overlay.For the
nrf54h20dk_nrf54h20_cpuapp
, the following sample overlay reduces
the default size of thestorage_partition
and adds the necessary
memfault_coredump_partition
entry:&mram1x { partitions { storage_partition: partition@1a4000 { reg = <0x1a4000 DT_SIZE_K(20)>; }; memfault_coredump_partition: partition@1b4000 { reg = <0x1a9000 DT_SIZE_K(20)>; }; }; };
-
Added example definition and usage of custom reboot reasons in the nRF9160
app. These reboot reasons can be triggered with a new shell command:
app reboot_custom <expected|unexpected>
-
🛠️ Changed
-
nRF-Connect SDK:
- Moved the default statement setting
CONFIG_MEMFAULT_HTTP_USES_MBEDTLS=n
whenCONFIG_NRF_MODEM_LIB=y
into the Memfault SDK Kconfig file. This
default currently exists in NCS in a symbol re-definition but will be
removed in the next version of NCS (v3.2
expected).
- Moved the default statement setting
-
Zephyr:
-
The default implementation of
memfault_zephyr_get_device_id()
, used to
populate the Device Serial, will use thehwinfo_get_device_id()
value by
default ifCONFIG_HWINFO
is enabled. Previously this also required
CONFIG_MEMFAULT_REBOOT_REASON_GET_HWINFO=y
, and would default to
{BOARD}-testserial
when that was not enabled. -
Add several new built-in BLE metrics:
bt_gatt_mtu_size
bt_connection_remote_info
bt_connection_event_count
bt_connection_interval
bt_connection_latency
bt_connection_timeout
bt_connection_rssi
bt_connected_time_ms
bt_disconnect_count
These metrics are enabled by default when
CONFIG_BT=y
and
CONFIG_BT_CONN=y
.
-
-
ESP-IDF:
-
Support
CONFIG_ESP_HTTPS_OTA_ENABLE_PARTIAL_DOWNLOAD
optional HTTP client
parameters in upcoming ESP-IDF v6
(this change
made them optionally declared). -
Update the post-link steps to be compatible with upcoming ESP-IDF build
changes for ESP-IDF > 5.5.
-
🐛 Fixed
-
ESP-IDF
- Fixed a bug where some FreeRTOS symbols needed for thread awareness were
missing from coredumps if the coredump storage was too small.
- Fixed a bug where some FreeRTOS symbols needed for thread awareness were
1.28.0
This is a minor update release. Highlights:
- added a new test command for simulating hangs in ISRs
- improved NMI exception capture
- fixed a build issue in the nRF-Connect SDK port
📈 Added
-
Zephyr:
-
Add a new test command,
mflt test isr_hang
, which will cause a busy loop
hang inside ak_timer
, which normally is executing from an ISR context.
The system will only exit this condition if there is a watchdog or other
higher-priority interrupt capable of preempting thek_timer
ISR. The
qemu
sample app is updated to enable a watchdog
which generates an NMI exception, caught by Memfault. -
Added a debug print when uploading data using
CONFIG_MEMFAULT_HTTP_PERIODIC_UPLOAD
that shows the bytes sent:[00:09:45.821,000] <dbg> mflt: memfault_platform_log: Uploaded 118 bytes of Memfault data
Only enabled when debug level prints are enabled for Memfault
(CONFIG_MEMFAULT_LOG_LEVEL_DBG=y
).
-
🛠️ Changed
-
Zephyr:
-
NMI exceptions are now properly handled. Prior to this change, a coredump
was captured on NMI exceptions but the MSP context was not fully unwound and
the NVIC state was not included in the trace data. -
Add a new Kconfig option,
CONFIG_MEMFAULT_COREDUMP_NVIC_INTERRUPTS_TO_COLLECT
, which controls the
existingmemfault_platform_config.h
setting
MEMFAULT_NVIC_INTERRUPTS_TO_COLLECT
for Cortex-M targets. The default now
is to collect allNUM_IRQS
as defined by Zephyr, which on many platforms
will increase from the previous default of32
. This improves the
out-of-the-box information at the cost of 44 bytes in coredump storage
consumed per additional 32 interrupts. Some example deltas shown below,
including the byte delta in the stored coredump:Platform Previous Default New Default Byte Delta nRF52840 32 64 (*48, rounded up to nearest multiple of 32) +44 nRF91 32 96 (*65 rounded up) +88 nRF53 32 96 (*69 rounded up) +88 STM32F407 32 96 (*82 rounded up) +88 STM32H7B0 32 160 (*155 rounded up) +176 STM32H563 32 160 (*155 rounded up) +176 To restore the previous default, set
CONFIG_MEMFAULT_COREDUMP_NVIC_INTERRUPTS_TO_COLLECT=32
.
-
-
nRF-Connect SDK:
1.27.0
📈 Added
-
General:
-
Add a reference software watchdog port for the STM32L4 series LPTIM
peripheral. Users of the STM32 HAL can now compile in the reference port and
theMemfaultWatchdog_Handler
. The handler will save a coredump so the full
system state can be recovered when a watchdog takes place. More details can
be found in
ports/include/memfault/ports/watchdog.h
. -
Add CLI commands
wdg_enable
,wdg_disable
, andwdog_update <timeout_ms>
for testing a software watchdog port. These commands are disabled by default
and can be enabled for platforms using the minimal shell/console with
MEMFAULT_DEMO_CLI_WATCHDOG
.
-
-
Zephyr:
-
Add a new Kconfig option,
CONFIG_MEMFAULT_HTTP_MAX_MESSAGES_TO_SEND
, which
controls the max number of messages that will be sent in a single invocation
ofmemfault_zephyr_port_post_data()
or similar APIs. The default is100
,
which is suitable for most applications. Before this change, the limit was
hard coded to 5 messages, which was too low for systems with infrequent
upload intervals. -
Support building for
native_sim
on arm64 hosts (specifically, the
native_sim/native/64
target), in addition to x86 hosts.
-
🛠️ Changed
-
Zephyr:
-
Improve the default implementation of
memfault_platform_sanitize_address_range()
to include all memory
accessible by the kernel. This enables collection of heap-allocated task
control blocks, which was previously unsupported. Users with discontiguous
memory regions should provide their own implementation, as before. -
Prioritize the thread bookkeeping array when collecting thread information
in a coredump (whenCONFIG_MEMFAULT_COREDUMP_COLLECT_TASKS_REGIONS=y
, the
default). This improves the quality of the processed coredump if the
coredump region is too small to collect all stacks for all threads in the
system (impacts systems with many threads and limited coredump storage
space). -
Add a new Kconfig option,
CONFIG_MEMFAULT_HTTP_PACKETIZER_BUFFER_SIZE
,
which controls the size of the intermediate buffer used when reading data
from the underlying data source (coredump storage, log buffer, CDR, etc)
when uploading data to Memfault via HTTP. The default size is 128 bytes, and
1024 bytes on nRF91x series SOCs to better support modem trace CDR upload.
Thanks to @DematteisGiacomo for submitting this in
#92.
-
-
ESP-IDF:
-
Handle deprecated Deep Sleep API calls for upcoming ESP-IDF v5.5 and v6.
-
Supporting building with the Memfault CLI commands disabled,
CONFIG_MEMFAULT_CLI_ENABLED=n
. Thanks to @finger563 for reporting this
issue and providing a fix in
#93 🎉!
-
🐛 Fixed
-
Zephyr:
- Fix an issue where the socket file descriptor can potentially be leaked when
the connection terminated unexpectedly during an HTTP chunk upload. Thanks
to @DematteisGiacomo for submitting this in
#92.
- Fix an issue where the socket file descriptor can potentially be leaked when
1.26.1
1.26.0
This is a feature release, primarily addressing future compatibility changes for
the next nRF-Connect SDK release.
📈 Added
-
Zephyr:
-
Add support for the ESP32 chip on Zephyr, adding to the existing support for
ESP32-S3 and ESP32 C series chips. -
Add support for building the Memfault SDK on the
native_sim
board. Note
that Memfault does not support reboot tracking or coredumps on this target,
but other features are supported.
-
🛠️ Changed
-
General:
- Add a
MEMFAULT_ENABLE_WARNING(warning)
macro complementing the existing
MEMFAULT_DISABLE_WARNING(warning)
macro. This macro is only implemented
for GCC + Clang.
- Add a
-
Zephyr:
-
Remove the External Module logic, used to support multiple Zephyr versions,
and instead use the normal Zephyr module Kconfig path specifier. There
should be no user-facing changes from this change. It addresses an issue
with Kconfig symbol linting. -
In the Zephyr QEMU sample app, add
the--param=min-pagesize=0x1000
compiler option, which will catch
dereferences to low memory addresses. This is only for static analysis
purposes and does not affect any behavior.
-
-
ESP-IDF:
- The heartbeat metrics timer is now enabled by default when
CONFIG_MEMFAULT_DEEP_SLEEP_SUPPORT=y
. Version1.25.0
, which added deep
sleep support, had disabled the normal heartbeat metrics timer by default.
The default behavior can be overridden with the Kconfig option
CONFIG_MEMFAULT_METRICS_HEARTBEAT_TIMER_ENABLE
.
- The heartbeat metrics timer is now enabled by default when
-
nRF-Connect SDK:
- Replace use of
LTE_LC_ON_CFUN
withNRF_MODEM_LIB_ON_CFUN
for nRF-Connect
SDK v2.8.0+. This deprecated API is scheduled to be removed in the next
nRF-Connect SDK release.
- Replace use of
1.25.0
This is a feature release of the Memfault Firmware SDK. The main new feature
released in this version is support for tracking metrics through deep sleep on
ESP32 devices. Full release notes are below.
📈 Added
-
Zephyr:
-
Add a new choice config
CONFIG_MEMFAULT_REBOOT_REASON_GET
. By default,
CONFIG_MEMFAULT_REBOOT_REASON_GET_HWINFO=y
, which is supported by
imply CONFIG_HWINFO
in the overarchingMEMFAULT
symbol. This default
enables better reboot reasons out-of-the-box via Zephyr'shwinfo
module.
The fall-back option isCONFIG_MEMFAULT_REBOOT_REASON_GET_BASIC
, which
provides a simple implementation. As before, users can override the default
implementations withCONFIG_MEMFAULT_REBOOT_REASON_GET_CUSTOM=y
. -
Add a new Kconfig setting,
CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP
, to
print the reboot reason code on system boot, for debugging purposes. This
feature is enabled by default. It can be disabled with
CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP=n
. -
Add a
boot_time_ms
metric, which tracks how long the system takes to boot
the application. Can be disabled withCONFIG_MEMFAULT_METRICS_BOOT_TIME=n
. -
Add new builtin Wi-Fi metrics, enabled by default when
CONFIG_WIFI=y
, and
can be disabled withCONFIG_MEMFAULT_METRICS_WIFI=n
:wifi_beacon_interval
wifi_dtim_interval
wifi_frequency_band
wifi_primary_channel
wifi_security_type
wifi_sta_rssi
wifi_standard_version
wifi_twt_capable
wifi_tx_rate_mbps
(Zephyr 4.1.0+ only)
These add on top of the existing Zephyr Wi-Fi metrics:
wifi_ap_oui
wifi_connected_time_ms
wifi_disconnect_count
-
Add an option to upload logs by default when using
MEMFAULT_HTTP_PERIODIC_UPLOAD
, controlled with the Kconfig symbol
MEMFAULT_HTTP_PERIODIC_UPLOAD_LOGS
. This can also be controlled at runtime
with the included API
memfault_zephyr_port_http_periodic_upload_logs(bool enable)
-
Add a new Kconfig option,
CONFIG_MEMFAULT_PLATFORM_TIME_SINCE_BOOT_CUSTOM
,
to provide a custom implementation of
memfault_platform_get_time_since_boot_ms()
in your application. The
default is an implementation usingk_uptime_get()
.
-
-
ESP-IDF:
-
Add a
boot_time_ms
metric, which tracks how long the system takes to boot
the application. Can be disabled withCONFIG_MEMFAULT_METRICS_BOOT_TIME=n
. -
Add support for tracking metrics across ESP32 deep sleep cycles, enabled
with the KconfigCONFIG_MEMFAULT_DEEP_SLEEP_SUPPORT=y
. To utilize this
feature, these functions must be called by the application:-
memfault_platform_deep_sleep_save_state()
Must be called just prior to entering deep sleep
(esp_deep_sleep_start()
) -
memfault_platform_deep_sleep_restore_state()
Must be called before
memfault_platform_boot()
in the application
startup sequence.
This feature includes built-in metrics for tracking deep sleep:
deep_sleep_time_ms
- time spent in deep sleepactive_time_ms
- time spent out of deep sleepdeep_sleep_wakeup_count
- number of times the device woke up from deep
sleep
There are several Kconfig options for controlling the deep sleep feature,
including controlling the heartbeat trigger and HTTP periodic upload. See
menuconfig
"Memfault deep sleep support" or
ports/esp_idf/memfault/Kconfig
for
details. -
-
Add new metrics tracking flash usage:
flash_spi_erase_bytes
flash_spi_write_bytes
flash_spi_total_size_bytes
-
Add capture of the ESP-IDF Task Watchdog stuck task list in coredumps. This
is enabled by default if ESP-IDF Task Watchdog is enabled, and can be
disabled with the Kconfig
CONFIG_MEMFAULT_COREDUMP_CAPTURE_TASK_WATCHDOG=n
.
-
🛠️ Changed
-
nRF Connect SDK:
CONFIG_MEMFAULT_REBOOT_REASON_GET_CUSTOM
is now a choice in the new choice
configCONFIG_MEMFAULT_REBOOT_REASON_GET
. As a result, it will be the
default choice ifCONFIG_MEMFAULT_NRF_CONNECT_SDK=y
instead of being
imply
-ed byCONFIG_MEMFAULT_NRF_CONNECT_SDK
to work around the
restriction that choice configs cannot be selected. As before, users can
override this behavior withCONFIG_MEMFAULT_REBOOT_REASON_GET_CUSTOM=n
.
-
ESP-IDF:
-
Rename
CONFIG_MEMFAULT_TIME_SINCE_BOOT_CUSTOM
->
CONFIG_MEMFAULT_PLATFORM_TIME_SINCE_BOOT_CUSTOM
. A new ESP-IDF port choice
KconfigCONFIG_MEMFAULT_PLATFORM_TIME_SINCE_BOOT
now supports 3 settings
for platform time since boot:MEMFAULT_PLATFORM_TIME_SINCE_BOOT_ESP_TIMER
default, suitable for most
applicationsMEMFAULT_PLATFORM_TIME_SINCE_BOOT_DEEP_SLEEP
applicable for deep-sleep
applicationsMEMFAULT_PLATFORM_TIME_SINCE_BOOT_CUSTOM
disable builtin
implementations and implement a custom
memfault_platform_get_time_since_boot_ms()
-
Renamed the
spi_flash_chip_id
metric (added in1.23.0
) to
flash_spi_manufacturer_id
. -
Renamed the
wifi_auth_mode
metric towifi_security_type
to more
accurately indicate the property being measured.
-
-
General:
-
Add the
demo
component to the default set of components added to an
Eclipse project when using the
eclipse_patch.py
utility. The default
components can be overridden with the--components
argument. -
Coredumps no longer include the device serial by default. The uploading
serial (passed to the chunks endpoint) is instead used to identify the
device associated with the coredump. Enabling
#define MEMFAULT_EVENT_INCLUDE_DEVICE_SERIAL 1
in
memfault_platform_config.h
will include the device serial in coredumps.
-
🐛 Fixed
-
ESP-IDF:
-
Remove debug logging from
memfault_platform_time_get_current()
. When log
timestamps are enabled, and debug level logs are enabled, this function can
infinitely recurse. -
Fix Memfault Build ID insertion when
CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES=y
. Previously, the build ID was
inserted at the wrong build step, resulting in a missing build ID in the
flashable image.
-
-
Zephyr:
-
Remove debug logging from the RTC-backed
memfault_platform_time_get_current()
(enabled when
CONFIG_MEMFAULT_SYSTEM_TIME_SOURCE_RTC=y
). When log timestamps are
enabled, logging from this function can result in infinite recursion under
certain conditions. -
Update the west module allowlist to include
cmsis_6
in the
Zephyr QEMU Sample App. Thecmsis_6
module is now used for TF-M and Cortex-M as of
this PR. -
Update the Memfault Zephyr logging backend to properly capture log lines
whenCONFIG_LOG_MODE_IMMEDIATE=y
on Zephyr 3.7.0+.
-
-
Wiced:
- Fix broken symlinks in the Wiced example.
1.24.0
📈 Added
-
General:
- Add a new API,
memfault_log_get_unsent_count()
, which returns the log
count and size in bytes of unsent logs in the log buffer. This can be used
insidememfault_log_handle_saved_callback()
for example to drain the
packetized logs when a certain watermark is reached.
- Add a new API,
-
ESP-IDF:
-
Add a Kconfig option,
CONFIG_MEMFAULT_TIME_SINCE_BOOT_CUSTOM
, which when
set=n
, enables using a custom implementation of
memfault_platform_get_time_since_boot_ms()
. -
Add 2 new metrics for tracking raw network bytes rx / tx. These metrics
track network IO traffic on the default netif:network_rx_bytes
network_tx_bytes
These metrics are enabled by default, and can be disabled with
CONFIG_MEMFAULT_METRICS_NETWORK_IO=n
-
🛠️ Changed
-
FreeRTOS (including ESP-IDF):
-
Rename the thread stack usage measurement variable included in coredumps
whenMEMFAULT_COREDUMP_COMPUTE_THREAD_STACK_USAGE
is enabled from
high_watermark
tostack_unused
. This change is to make the
implementation more readable. The Memfault backend is updated to process
both the old and new formats. -
FreeRTOS-detected stack overflows (via
vApplicationStackOverflowHook
) will
now be correctly tagged asStack Overflow
for the trace reason in
Memfault, instead ofAssert
.
-
🐛 Fixed
-
Zephyr:
- Fix a null dereference when calling
memfault_coredump_storage_compute_size_required()
(eg the shell command
mflt coredump_size
).
- Fix a null dereference when calling
-
General:
-
For the emlib WDOG port implementation,
ports/emlib/wdog_software_watchdog.c
,
enable the WDOG when in EM1 mode for series2 chips. -
Added support for
MEMFAULT_REBOOT_REASON_CLEAR
in the
ports/nrf5_sdk/resetreas_reboot_tracking.c
implementation, by default enabled (like other ports). This permits opting
out of the auto-clearing of theNRF_POWER->RESETREAS
register, in case the
user needs it after the function runs.
-
-
FreeRTOS (including ESP-IDF):
-
Fix incorrect computation of per-thread stack usage metrics
(MEMFAULT_FREERTOS_COLLECT_THREAD_METRICS
). Before this fix, the returned
values had 2 errors:- the value is the unused stack space, not the used stack space
- on platforms where
sizeof(StackType_t)
is not 1 byte, the numerator
when computing percentage is incorrectly scaled down by
sizeof(StackType_t)
, resulting in significant under-reporting of the
stack usage percentage.
Users can apply device and software version filtering on dashboards to
filter out reports from devices that are running an old version of the SDK.
-
-
ESP-IDF:
- Fix a potential issue that would cause the wrong implementation of
memfault_platform_time_get_current()
to be included in the final link,
whenCONFIG_MEMFAULT_SYSTEM_TIME=y
is enabled (default).
- Fix a potential issue that would cause the wrong implementation of
🛠️ Changed
-
ESP-IDF:
CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP
now defaults toy
instead of
n
, to print out the reboot reason on boot. Disable it with
CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP=n
.
1.23.1
🐛 Fixed
- Modify the test command used in our public CircleCI job, to work around an
issue with
CircleCI's v2 container runtime,
which usescgroupv2
instead ofcgroupv1
.