Skip to content

Releases: memfault/memfault-firmware-sdk

1.30.1

03 Oct 19:54
Compare
Choose a tag to compare

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 where CONFIG_LOG_MODE_IMMEDIATE=n and
      MEMFAULT_LOG_TIMESTAMPS_ENABLE is 1.
  • General:

    • Added Python type annotations to the files in the tasks directory.

1.30.0

23 Sep 15:02
Compare
Choose a tag to compare

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
      with CONFIG_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
      via CONFIG_MEMFAULT_FS_BYTES_FREE_VFS_PATH still takes precedence when
      set. If not using fstab, set CONFIG_MEMFAULT_FS_BYTES_FREE_METRIC=y to
      enable collection.

🐛 Fixed

  • nRF-Connect SDK:

    • Increase the default value of
      CONFIG_MEMFAULT_HTTP_DEDICATED_WORKQUEUE_STACK_SIZE to 4kB when uploading
      via WiFi on the nRF70 series. This avoids potential stack overflows caused
      while performing periodic uploads via HTTP. Thanks to
      @chshzh for reporting this and proposing a fix
      in #95!

1.29.0

11 Sep 14:34
Compare
Choose a tag to compare

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.
  • 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 named memfault_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 named memfault_coredump_partition, for example via a devicetree
      overlay.

      For the nrf54h20dk_nrf54h20_cpuapp, the following sample overlay reduces
      the default size of the storage_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
      when CONFIG_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).
  • Zephyr:

    • The default implementation of memfault_zephyr_get_device_id(), used to
      populate the Device Serial, will use the hwinfo_get_device_id() value by
      default if CONFIG_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.

1.28.0

01 Aug 23:59
Compare
Choose a tag to compare

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 a k_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 the k_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
      existing memfault_platform_config.h setting
      MEMFAULT_NVIC_INTERRUPTS_TO_COLLECT for Cortex-M targets. The default now
      is to collect all NUM_IRQS as defined by Zephyr, which on many platforms
      will increase from the previous default of 32. 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:

    • Fix a build issue impacting some nRF54 series chips related to reboot reason
      decoding. Thanks to @grochu for providing the
      fix in #94 🎉!

1.27.0

21 Jul 17:49
Compare
Choose a tag to compare

📈 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
      the MemfaultWatchdog_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, and wdog_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
      of memfault_zephyr_port_post_data() or similar APIs. The default is 100,
      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 (when CONFIG_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.

1.26.1

30 Jun 14:14
Compare
Choose a tag to compare

This is a minor fix release, addressing one future compatibility issue with the
Zephyr port.

🛠️ Changed

  • Zephyr:

    • Apply a compatibility fix for upcoming Zephyr 4.2.0, fixing the size of the
      net_mgmt callback mgmt_event parameter. Thanks to @rlubos for providing
      the fix in #91
      🎉!

1.26.0

26 Jun 20:05
Compare
Choose a tag to compare

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.
  • 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. Version 1.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.
  • nRF-Connect SDK:

    • Replace use of LTE_LC_ON_CFUN with NRF_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.

1.25.0

10 Jun 14:17
Compare
Choose a tag to compare

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 overarching MEMFAULT symbol. This default
      enables better reboot reasons out-of-the-box via Zephyr's hwinfo module.
      The fall-back option is CONFIG_MEMFAULT_REBOOT_REASON_GET_BASIC, which
      provides a simple implementation. As before, users can override the default
      implementations with CONFIG_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 with CONFIG_MEMFAULT_METRICS_BOOT_TIME=n.

    • Add new builtin Wi-Fi metrics, enabled by default when CONFIG_WIFI=y, and
      can be disabled with CONFIG_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 using k_uptime_get().

  • ESP-IDF:

    • Add a boot_time_ms metric, which tracks how long the system takes to boot
      the application. Can be disabled with CONFIG_MEMFAULT_METRICS_BOOT_TIME=n.

    • Add support for tracking metrics across ESP32 deep sleep cycles, enabled
      with the Kconfig CONFIG_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 sleep
      • active_time_ms - time spent out of deep sleep
      • deep_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
      config CONFIG_MEMFAULT_REBOOT_REASON_GET. As a result, it will be the
      default choice if CONFIG_MEMFAULT_NRF_CONNECT_SDK=y instead of being
      imply-ed by CONFIG_MEMFAULT_NRF_CONNECT_SDK to work around the
      restriction that choice configs cannot be selected. As before, users can
      override this behavior with CONFIG_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
      Kconfig CONFIG_MEMFAULT_PLATFORM_TIME_SINCE_BOOT now supports 3 settings
      for platform time since boot:

      1. MEMFAULT_PLATFORM_TIME_SINCE_BOOT_ESP_TIMER default, suitable for most
        applications
      2. MEMFAULT_PLATFORM_TIME_SINCE_BOOT_DEEP_SLEEP applicable for deep-sleep
        applications
      3. MEMFAULT_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 in 1.23.0) to
      flash_spi_manufacturer_id.

    • Renamed the wifi_auth_mode metric to wifi_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. The cmsis_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
      when CONFIG_LOG_MODE_IMMEDIATE=y on Zephyr 3.7.0+.

  • Wiced:

1.24.0

06 May 18:45
Compare
Choose a tag to compare

📈 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
      inside memfault_log_handle_saved_callback() for example to drain the
      packetized logs when a certain watermark is reached.
  • 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
      when MEMFAULT_COREDUMP_COMPUTE_THREAD_STACK_USAGE is enabled from
      high_watermark to stack_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 as Stack Overflow for the trace reason in
      Memfault, instead of Assert.

🐛 Fixed

  • Zephyr:

    • Fix a null dereference when calling
      memfault_coredump_storage_compute_size_required() (eg the shell command
      mflt coredump_size).
  • 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 the NRF_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:

      1. the value is the unused stack space, not the used stack space
      2. 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,
      when CONFIG_MEMFAULT_SYSTEM_TIME=y is enabled (default).

🛠️ Changed

  • ESP-IDF:

    • CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP now defaults to y instead of
      n, to print out the reboot reason on boot. Disable it with
      CONFIG_MEMFAULT_ENABLE_REBOOT_DIAG_DUMP=n.

1.23.1

17 Apr 22:17
Compare
Choose a tag to compare

🐛 Fixed

  • Modify the test command used in our public CircleCI job, to work around an
    issue with
    CircleCI's v2 container runtime,
    which uses cgroupv2 instead of cgroupv1.