Memfault Firmware SDK 1.30.3 (Build 15552)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1b9225..f0fb57a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,58 @@
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.30.3] - 2025-10-23
+
+This is a patch release, fixing build errors and one bug.
+
+### 🛠️ Changed
+
+- Zephyr:
+
+ - Update the RRAM coredump storage backend implementation to support the
+ Nordic nRF54LM20 (and other Nordic nRF54L series chips) when not using
+ partition manager to assign flash regions (i.e. using device tree fixed
+ partitions). See
+ [`ports/zephyr/common/memfault_rram_backed_coredump.c`](ports/zephyr/common/memfault_rram_backed_coredump.c)
+ for details, and how to enable the coredump storage backend.
+
+ - Fix a compilation error when `CONFIG_MEMFAULT_METRICS_THREADS_DEFAULTS=n`.
+
+ - Remove an error log statement from
+ [`memfault_platform_thread_metrics.c`](ports/zephyr/common/memfault_platform_thread_metrics.c).
+ Previously this would log as
+ `<err> mflt: No thread name registered for 0x2000eae8`, for example, but was
+ not useful in many cases, and is not an error in any case.
+
+### 🐛 Fixed
+
+- ESP-IDF:
+
+ - Fix a compilation issue when building the [ESP32 sample app](examples/esp32)
+ for an ESP32-C6 with `MEMFAULT_DISABLE=` set (i.e.
+ `MEMFAULT_DISABLE=1 idf.py set-target esp32c6 build`). This only impacts the
+ sample application.
+
+- Zephyr:
+
+ - Disable invoking `LOG_PANIC()` during fault handling by default. When
+ deferred logging is used (`CONFIG_LOG_MODE_DEFERRED=y`), triggering a panic
+ flush from fault context may result in some log backends
+ (`CONFIG_SHELL_LOG_BACKEND` for example) to double-fault, which results in
+ failed coredump captures. This specifically can happen when running a
+ non-secure application with TF-M, and passing back from a secure fault
+ handler using `CONFIG_TFM_ALLOW_NON_SECURE_FAULT_HANDLING=y`. Users who are
+ comfortable enabling this can re-enable `LOG_PANIC()` with
+ `CONFIG_MEMFAULT_FAULT_HANDLER_LOG_PANIC=y`.
+
+ - Remove an unnecessary `depends on PARTITION_MANAGER_ENABLED` in the
+ `MEMFAULT_COREDUMP_STORAGE_RRAM` Kconfig setting. This feature only requires
+ a partition labeled `memfault_coredump_partition`, but does not require
+ partition manager specifically (which is a Nordic nRF-Connect SDK feature,
+ not a Zephyr feature). Thanks to
+ [@JordanYates](https://github.com/JordanYates) for reporting this issue in
+ [#96](https://github.com/memfault/memfault-firmware-sdk/issues/96)!
+
## [1.30.2] - 2025-10-10
This is a patch release, including only a change to boolean Kconfig prompts so
@@ -40,7 +92,7 @@
### 📈 Added
-- Zephyr
+- Zephyr:
- Add Kconfig option
`CONFIG_MEMFAULT_COREDUMP_ACTIVE_TASK_STACK_SIZE_TO_COLLECT` to control how
@@ -56,7 +108,7 @@
### 🛠️ Changed
-- Zephyr
+- Zephyr:
- Replace use of deprecated API `bt_hci_cmd_create()` with
`bt_hci_cmd_alloc()` for Zephyr 4.2+.
diff --git a/VERSION b/VERSION
index ba0e426..d55eb61 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,3 @@
-BUILD ID: 15462
-GIT COMMIT: b238b31908
-VERSION: 1.30.2
+BUILD ID: 15552
+GIT COMMIT: b8b409dcbf
+VERSION: 1.30.3
diff --git a/components/include/memfault/version.h b/components/include/memfault/version.h
index 089ffd5..dce4e03 100644
--- a/components/include/memfault/version.h
+++ b/components/include/memfault/version.h
@@ -20,8 +20,8 @@
} sMfltSdkVersion;
#define MEMFAULT_SDK_VERSION \
- { .major = 1, .minor = 30, .patch = 2 }
-#define MEMFAULT_SDK_VERSION_STR "1.30.2"
+ { .major = 1, .minor = 30, .patch = 3 }
+#define MEMFAULT_SDK_VERSION_STR "1.30.3"
#ifdef __cplusplus
}
diff --git a/examples/esp32/apps/memfault_demo_app/main/led.c b/examples/esp32/apps/memfault_demo_app/main/led.c
index 500ebb3..14ef9e9 100644
--- a/examples/esp32/apps/memfault_demo_app/main/led.c
+++ b/examples/esp32/apps/memfault_demo_app/main/led.c
@@ -102,7 +102,9 @@
}
#endif // ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
-static void prv_heartbeat_led_callback(MEMFAULT_UNUSED TimerHandle_t handle) {
+static void prv_heartbeat_led_callback(TimerHandle_t handle) {
+ (void)handle;
+
static bool s_led_state = true;
/* If the addressable LED is enabled */
diff --git a/examples/esp32/apps/memfault_demo_app/main/main.c b/examples/esp32/apps/memfault_demo_app/main/main.c
index d679c8a..bf55c0f 100644
--- a/examples/esp32/apps/memfault_demo_app/main/main.c
+++ b/examples/esp32/apps/memfault_demo_app/main/main.c
@@ -361,7 +361,7 @@
}
#endif
-#if !defined(CONFIG_MEMFAULT_LOG_USE_VPRINTF_HOOK)
+#if defined(CONFIG_MEMFAULT) && !defined(CONFIG_MEMFAULT_LOG_USE_VPRINTF_HOOK)
// Demonstrate a custom vprintf hook that prefixes all log messages with
// "[IDF]", before invoking the Memfault log hook, and then printing to stdout.
static int prv_vprintf_hook(const char *fmt, va_list args) {
diff --git a/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.conf b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.conf
new file mode 100644
index 0000000..6e01cf8
--- /dev/null
+++ b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.conf
@@ -0,0 +1,7 @@
+# Use RRAM internal storage implementation instead of flash-based
+CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP=n
+CONFIG_MEMFAULT_COREDUMP_STORAGE_RRAM=y
+
+# Place the noinit objects into a custom section.
+CONFIG_MEMFAULT_REBOOT_TRACKING_REGION="memfault_noinit.memfault_reboot_info"
+CONFIG_MEMFAULT_RAM_BACKED_COREDUMP_REGION="memfault_noinit.memfault_coredump"
diff --git a/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay.example b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay.example
new file mode 100644
index 0000000..af35b14
--- /dev/null
+++ b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay.example
@@ -0,0 +1,19 @@
+/*
+ Example device tree overlay for the nrf54lm20dk, showing how to set a
+ fixed-partition region for RRAM-backed coredump storage. Pass it with
+ '-DDTC_OVERLAY_FILE=boards/nrf54lm20pdk_nrf54lm20a_cpuapp.overlay.example'
+ when building.
+*/
+
+&cpuapp_rram {
+ partitions {
+ storage_partition: partition@1d1000 {
+ label = "storage";
+ reg = < 0x1d1000 0x4000 >;
+ };
+ memfault_coredump_partition: partition@1d5000 {
+ label = "memfault_coredump_partition";
+ reg = <0x1d5000 0x5000>;
+ };
+ };
+};
diff --git a/examples/nrf-connect-sdk/nrf5/memfault_demo_app/pm_static_nrf54lm20pdk_nrf54lm20a_cpuapp.yml b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/pm_static_nrf54lm20pdk_nrf54lm20a_cpuapp.yml
new file mode 100644
index 0000000..c223ecd
--- /dev/null
+++ b/examples/nrf-connect-sdk/nrf5/memfault_demo_app/pm_static_nrf54lm20pdk_nrf54lm20a_cpuapp.yml
@@ -0,0 +1,80 @@
+EMPTY_0:
+ address: 0xd800
+ end_address: 0xe000
+ placement:
+ after:
+ - mcuboot
+ region: flash_primary
+ size: 0x800
+memfault_coredump_partition:
+ address: 0x1fc000
+ end_address: 0x1fd000
+ placement:
+ after:
+ - mcuboot_secondary
+ region: flash_primary
+ size: 0x1000
+app:
+ address: 0xe800
+ end_address: 0x105000
+ region: flash_primary
+ size: 0xf6800
+bootconf:
+ address: 0xffd080
+ end_address: 0xffd084
+ region: bootconf
+ size: 0x4
+mcuboot:
+ address: 0x0
+ end_address: 0xd800
+ placement:
+ align:
+ end: 0x1000
+ before:
+ - mcuboot_primary
+ region: flash_primary
+ size: 0xd800
+mcuboot_pad:
+ address: 0xe000
+ end_address: 0xe800
+ placement:
+ before:
+ - mcuboot_primary_app
+ region: flash_primary
+ size: 0x800
+mcuboot_primary:
+ address: 0xe000
+ end_address: 0x105000
+ orig_span: &id001
+ - app
+ - mcuboot_pad
+ region: flash_primary
+ sharers: 0x1
+ size: 0xf7000
+ span: *id001
+mcuboot_primary_app:
+ address: 0xe800
+ end_address: 0x105000
+ orig_span: &id002
+ - app
+ region: flash_primary
+ size: 0xf6800
+ span: *id002
+mcuboot_secondary:
+ address: 0x105000
+ end_address: 0x1fc000
+ placement:
+ after:
+ - mcuboot_primary
+ align:
+ start: 0x1000
+ align_next: 0x1000
+ region: flash_primary
+ share_size:
+ - mcuboot_primary
+ size: 0xf7000
+sram_primary:
+ address: 0x20000000
+ end_address: 0x2007fc00
+ region: sram_primary
+ size: 0x7fc00
diff --git a/ports/zephyr/Kconfig b/ports/zephyr/Kconfig
index b8ff4e5..b962655 100644
--- a/ports/zephyr/Kconfig
+++ b/ports/zephyr/Kconfig
@@ -83,7 +83,6 @@
config MEMFAULT_COREDUMP_STORAGE_RRAM
bool "RRAM backed coredump storage"
depends on NRFX_RRAMC
- depends on PARTITION_MANAGER_ENABLED
help
Use an internal RRAM-backed coredump storage implementation. Requires
a partition labeled `memfault_coredump_partition`.
@@ -872,6 +871,15 @@
instead of rebooting the system. Useful if the system needs to hook into
`k_sys_fatal_error_handler` at the end of system fault handling.
+config MEMFAULT_FAULT_HANDLER_LOG_PANIC
+ bool "Trigger LOG_PANIC() on fault handling"
+ default n
+ help
+ When enabled, the Memfault fault handler will call `LOG_PANIC()` to
+ flush logs during fault handling. Note that this can cause unexpected
+ behavior in some log backends that are not safe to call from fault
+ context.
+
choice MEMFAULT_SYSTEM_TIME_SOURCE
prompt "Memfault system time source"
default MEMFAULT_SYSTEM_TIME_SOURCE_DATETIME if DATE_TIME
diff --git a/ports/zephyr/common/memfault_mram_backed_coredump.c b/ports/zephyr/common/memfault_mram_backed_coredump.c
index fd59b80..f2a7dd6 100644
--- a/ports/zephyr/common/memfault_mram_backed_coredump.c
+++ b/ports/zephyr/common/memfault_mram_backed_coredump.c
@@ -2,6 +2,35 @@
//!
//! Copyright (c) Memfault, Inc.
//! See LICENSE for details
+//!
+//! MRAM backed coredump storage implementation. To make use of this, be sure to
+//! add a fixed partition named "memfault_coredump_partition" to your device
+//! tree or use partition manager to define one.
+//!
+//! For example, if using partition manager, you might add an entry like this to
+//! the application's pm_static.yml file:
+//!
+//! memfault_coredump_partition:
+//! address: 0x155000
+//! end_address: 0x165000
+//! placement:
+//! align:
+//! start: 0x1000
+//! before:
+//! - end
+//! region: flash_primary
+//! size: 0x10000
+//!
+//! If using device tree specified partitions, you might add something like this
+//! to your board's dts file/overlay:
+//!
+//! &mram1x {
+//! partitions {
+//! memfault_coredump_partition: partition@1a9000 {
+//! reg = <0x1a9000 DT_SIZE_K(20)>;
+//! };
+//! };
+//! };
#include <memfault/components.h>
#include <zephyr/drivers/flash.h>
diff --git a/ports/zephyr/common/memfault_platform_core.c b/ports/zephyr/common/memfault_platform_core.c
index a72282d..dcff66b 100644
--- a/ports/zephyr/common/memfault_platform_core.c
+++ b/ports/zephyr/common/memfault_platform_core.c
@@ -24,6 +24,7 @@
#include "memfault/ports/reboot_reason.h"
#include "memfault/ports/zephyr/core.h"
#include "memfault/ports/zephyr/log_backend.h"
+#include "memfault/ports/zephyr/log_panic.h"
#include MEMFAULT_ZEPHYR_INCLUDE(sys/__assert.h)
#include "memfault/ports/zephyr/version.h"
// clang-format on
@@ -50,7 +51,7 @@
// in the log buffer. That should be an unusual configuration, since the fault
// register capture disable is a very small size optimization, and logs are
// likely not used on devices with space constraints.
- LOG_PANIC();
+ MEMFAULT_LOG_PANIC();
#if !defined(CONFIG_LOG_MODE_MINIMAL)
memfault_zephyr_log_backend_disable();
#endif
diff --git a/ports/zephyr/common/memfault_rram_backed_coredump.c b/ports/zephyr/common/memfault_rram_backed_coredump.c
index eea7f7e..8279fa5 100644
--- a/ports/zephyr/common/memfault_rram_backed_coredump.c
+++ b/ports/zephyr/common/memfault_rram_backed_coredump.c
@@ -2,6 +2,34 @@
//!
//! Copyright (c) Memfault, Inc.
//! See LICENSE for details
+//!
+//! RRAM backed coredump storage implementation. To make use of this, be sure to
+//! add a fixed partition named "memfault_coredump_partition" to your device
+//! tree or use partition manager to define one.
+//!
+//! For example, if using partition manager, you might add an entry like this to
+//! the application's pm_static.yml file:
+//!
+//! memfault_coredump_partition:
+//! address: 0x1fc000
+//! end_address: 0x1fd000
+//! placement:
+//! after:
+//! - mcuboot_secondary
+//! region: flash_primary
+//! size: 0x1000
+//!
+//! If using device tree specified partitions, you might add something like this
+//! to your board's dts file/overlay:
+//!
+//! &mram1x {
+//! partitions {
+//! memfault_coredump_partition: partition@1d5000 {
+//! label = "memfault_coredump_partition";
+//! reg = <0x1d5000 0x5000>;
+//! };
+//! };
+//! };
#include <hal/nrf_rramc.h>
#include <memfault/components.h>
@@ -15,18 +43,27 @@
#include <memfault/ports/buffered_coredump_storage.h>
// Ensure the memfault_coredump_partition entry exists
-#if !FIXED_PARTITION_EXISTS(memfault_coredump_partition)
+
+// Fixed partitions in use
+#if DT_HAS_FIXED_PARTITION_LABEL(memfault_coredump_partition)
+ #define MEMFAULT_COREDUMP_PARTITION_OFFSET \
+ DT_FIXED_PARTITION_ADDR(DT_NODELABEL(memfault_coredump_partition))
+ #define MEMFAULT_COREDUMP_PARTITION_SIZE DT_REG_SIZE(DT_NODELABEL(memfault_coredump_partition))
+
+// Partition-manager defined partitions
+#elif FIXED_PARTITION_EXISTS(memfault_coredump_partition)
+ #define MEMFAULT_COREDUMP_PARTITION_OFFSET FIXED_PARTITION_OFFSET(memfault_coredump_partition)
+ #define MEMFAULT_COREDUMP_PARTITION_SIZE FIXED_PARTITION_SIZE(memfault_coredump_partition)
+#else
#error "Be sure to add a fixed partition named 'memfault_coredump_partition'!"
#endif
-MEMFAULT_STATIC_ASSERT(FIXED_PARTITION_SIZE(memfault_coredump_partition) %
- MEMFAULT_COREDUMP_STORAGE_WRITE_SIZE ==
- 0,
+MEMFAULT_STATIC_ASSERT(MEMFAULT_COREDUMP_PARTITION_SIZE % MEMFAULT_COREDUMP_STORAGE_WRITE_SIZE == 0,
"Storage size must be a multiple of 128-bit (16 bytes)");
void memfault_platform_coredump_storage_get_info(sMfltCoredumpStorageInfo *info) {
*info = (sMfltCoredumpStorageInfo){
- .size = FIXED_PARTITION_SIZE(memfault_coredump_partition),
+ .size = MEMFAULT_COREDUMP_PARTITION_SIZE,
};
}
@@ -44,15 +81,14 @@
// special case: if the first word is 0, the coredump is cleared, and reads
// should return all zeros
- const uint32_t first_wordline =
- *(const uint32_t *)(FIXED_PARTITION_OFFSET(memfault_coredump_partition));
+ const uint32_t first_wordline = *(const uint32_t *)(MEMFAULT_COREDUMP_PARTITION_OFFSET);
if (first_wordline == 0) {
memset(data, 0, read_len);
return true;
}
// RRAM is memory mapped, so we can just read it directly
- const uint32_t address = FIXED_PARTITION_OFFSET(memfault_coredump_partition) + offset;
+ const uint32_t address = MEMFAULT_COREDUMP_PARTITION_OFFSET + offset;
memcpy(data, (void *)address, read_len);
return true;
@@ -68,7 +104,7 @@
}
bool memfault_platform_coredump_storage_buffered_write(sCoredumpWorkingBuffer *blk) {
- const uint32_t start_addr = FIXED_PARTITION_OFFSET(memfault_coredump_partition);
+ const uint32_t start_addr = MEMFAULT_COREDUMP_PARTITION_OFFSET;
const uint32_t addr = start_addr + blk->write_offset;
if (!prv_op_within_flash_bounds(blk->write_offset, MEMFAULT_COREDUMP_STORAGE_WRITE_SIZE)) {
diff --git a/ports/zephyr/common/metrics/memfault_platform_thread_metrics.c b/ports/zephyr/common/metrics/memfault_platform_thread_metrics.c
index 5920668..7e2a153 100644
--- a/ports/zephyr/common/metrics/memfault_platform_thread_metrics.c
+++ b/ports/zephyr/common/metrics/memfault_platform_thread_metrics.c
@@ -51,7 +51,7 @@
const char *name = k_thread_name_get((k_tid_t)thread);
if (!name || name[0] == '\0') {
- MEMFAULT_LOG_ERROR("No thread name registered for %p", thread);
+ return;
}
// Iterate over the thread list. A blank thread name indicates the end of the list.
diff --git a/ports/zephyr/include/memfault/ports/zephyr/log_panic.h b/ports/zephyr/include/memfault/ports/zephyr/log_panic.h
new file mode 100644
index 0000000..098842b
--- /dev/null
+++ b/ports/zephyr/include/memfault/ports/zephyr/log_panic.h
@@ -0,0 +1,22 @@
+#pragma once
+
+//! @file
+//!
+//! Copyright (c) Memfault, Inc.
+//! See LICENSE for details
+//!
+//! @brief Memfault Zephyr log backend APIs
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(MEMFAULT_FAULT_HANDLER_LOG_PANIC)
+ #define MEMFAULT_LOG_PANIC() LOG_PANIC()
+#else
+ #define MEMFAULT_LOG_PANIC()
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/ports/zephyr/include/memfault/ports/zephyr/thread_metrics.h b/ports/zephyr/include/memfault/ports/zephyr/thread_metrics.h
index af2b429..98ad4e8 100644
--- a/ports/zephyr/include/memfault/ports/zephyr/thread_metrics.h
+++ b/ports/zephyr/include/memfault/ports/zephyr/thread_metrics.h
@@ -45,8 +45,10 @@
//! },
//! );
extern const sMfltZephyrThreadMetricsIndex g_memfault_thread_metrics_index[];
-#define MEMFAULT_METRICS_DEFINE_THREAD_METRICS(...) \
- const sMfltZephyrThreadMetricsIndex g_memfault_thread_metrics_index[] = { __VA_ARGS__, { 0 } }
+#define MEMFAULT_METRICS_DEFINE_THREAD_METRICS(...) \
+ const sMfltZephyrThreadMetricsIndex g_memfault_thread_metrics_index[] = { \
+ __VA_ARGS__ __VA_OPT__(, ){ 0 } \
+ }
#ifdef __cplusplus
}
diff --git a/ports/zephyr/panics/memfault_fault_handler.c b/ports/zephyr/panics/memfault_fault_handler.c
index b16e23a..dd5cac5 100644
--- a/ports/zephyr/panics/memfault_fault_handler.c
+++ b/ports/zephyr/panics/memfault_fault_handler.c
@@ -21,6 +21,7 @@
#include "memfault/panics/coredump.h"
#include "memfault/panics/fault_handling.h"
#include "memfault/ports/zephyr/version.h"
+#include "memfault/ports/zephyr/log_panic.h"
// The z_fatal_error() signature changed in Zephyr 3.7.0, during release
// candidate development. NCS uses an intermediate version in NCS v2.7.0, so use
@@ -186,8 +187,8 @@
void __wrap_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
#endif
{
- // flush logs prior to capturing coredump & rebooting
- LOG_PANIC();
+ // Optionally flush logs prior to capturing coredump & rebooting
+ MEMFAULT_LOG_PANIC();
const struct __extra_esf_info *extra_info = &esf->extra_info;
const _callee_saved_t *callee_regs = extra_info->callee;
diff --git a/ports/zephyr/panics/memfault_fault_handler_posix.c b/ports/zephyr/panics/memfault_fault_handler_posix.c
index 2968b76..8d31661 100644
--- a/ports/zephyr/panics/memfault_fault_handler_posix.c
+++ b/ports/zephyr/panics/memfault_fault_handler_posix.c
@@ -21,6 +21,7 @@
#include "memfault/core/reboot_reason_types.h"
#include "memfault/panics/arch/posix/posix.h"
#include "memfault/panics/coredump.h"
+#include "memfault/ports/zephyr/log_panic.h"
#include "memfault/panics/fault_handling.h"
// clang-format on
@@ -83,7 +84,7 @@
void __wrap_z_fatal_error(unsigned int reason, const struct arch_esf *esf) {
// flush logs prior to capturing coredump & rebooting
- LOG_PANIC();
+ MEMFAULT_LOG_PANIC();
sMfltRegState reg = { 0 };
diff --git a/ports/zephyr/panics/memfault_fault_handler_riscv.c b/ports/zephyr/panics/memfault_fault_handler_riscv.c
index e326c17..d88b0b9 100644
--- a/ports/zephyr/panics/memfault_fault_handler_riscv.c
+++ b/ports/zephyr/panics/memfault_fault_handler_riscv.c
@@ -18,6 +18,7 @@
#include "memfault/panics/arch/riscv/riscv.h"
#include "memfault/panics/coredump.h"
#include "memfault/panics/fault_handling.h"
+#include "memfault/ports/zephyr/log_panic.h"
#include "memfault/ports/zephyr/version.h"
// Note: There is no header exposed for this zephyr function
@@ -47,7 +48,7 @@
{
// TODO log panic may not be working correctly in fault handler context :(
// // flush logs prior to capturing coredump & rebooting
- // LOG_PANIC();
+ // MEMFAULT_LOG_PANIC();
sMfltRegState reg = {
.mepc = esf->mepc, /* machine exception program counter */
diff --git a/ports/zephyr/panics/memfault_fault_handler_xtensa.c b/ports/zephyr/panics/memfault_fault_handler_xtensa.c
index c47019d..7a95f84 100644
--- a/ports/zephyr/panics/memfault_fault_handler_xtensa.c
+++ b/ports/zephyr/panics/memfault_fault_handler_xtensa.c
@@ -20,6 +20,7 @@
#include "memfault/panics/arch/xtensa/xtensa.h"
#include "memfault/panics/coredump.h"
#include "memfault/panics/fault_handling.h"
+#include "memfault/ports/zephyr/log_panic.h"
#include "memfault/ports/zephyr/version.h"
// Note: There is no header exposed for this zephyr function
@@ -49,7 +50,7 @@
{
// TODO log panic may not be working correctly in fault handler context :(
// // flush logs prior to capturing coredump & rebooting
- // LOG_PANIC();
+ // MEMFAULT_LOG_PANIC();
const _xtensa_irq_stack_frame_raw_t *frame = (void *)esf;
_xtensa_irq_bsa_t *bsa = frame->ptr_to_bsa;