Skip to content

Commit 0fc9185

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.33.3 (Build 517561)
1 parent 0cf1078 commit 0fc9185

File tree

7 files changed

+35
-71
lines changed

7 files changed

+35
-71
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### Changes between Memfault SDK 0.33.2 and SDK 0.33.3 - Sept 14, 2022
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- Zephyr port updates:
6+
- Add a call to `LOG_PANIC()` before running the Memfault fault handler, to
7+
flush any deferred logs before the reboot
8+
19
### Changes between Memfault SDK 0.33.1 and SDK 0.33.2 - Sept 7, 2022
210

311
#### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 512901
2-
GIT COMMIT: a0c2c2f58
1+
BUILD ID: 517561
2+
GIT COMMIT: a436bb3d2

components/include/memfault/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef struct {
1919
uint8_t patch;
2020
} sMfltSdkVersion;
2121

22-
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 33, .patch = 2 }
22+
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 33, .patch = 3 }
2323

2424
#ifdef __cplusplus
2525
}

ports/zephyr/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,6 @@ config MEMFAULT_HTTP_ENABLE
9292
Enables support for querying the Memfault API for OTA updates
9393
and posting Memfault chunks
9494

95-
config MEMFAULT_ZEPHYR_FATAL_HANDLER
96-
bool "Enable running the Zephyr fatal handler after Memfault coredump capture"
97-
default y
98-
help
99-
This enables the Zephyr fatal handler to run after Memfault's fault
100-
handler. It's useful to view the Zephyr fatal output (few breadcrumbs
101-
about the crash) on the console when debugging with an attached
102-
device. Explicitly disabling it can save a few dozen bytes of code
103-
space.
104-
10595
config MEMFAULT_PLATFORM_LOG_FALLBACK_TO_PRINTK
10696
bool "Fallback to printk for platform logging"
10797
default y if ! LOG

ports/zephyr/v2.4/memfault_fault_handler.c

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,10 @@ extern void sys_arch_reboot(int type);
4141
// Intercept zephyr/kernel/fatal.c:z_fatal_error()
4242
void __wrap_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf);
4343

44-
#if CONFIG_MEMFAULT_ZEPHYR_FATAL_HANDLER
45-
extern void __real_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf);
46-
47-
// This struct stores the crash info for later passing to __real_z_fatal_error
48-
static struct save_crash_info {
49-
bool valid;
50-
unsigned int reason;
51-
z_arch_esf_t esf;
52-
} s_save_crash_info;
53-
54-
// stash the reason and esf for later use by zephyr unwinder
55-
static void prv_save_crash_info(unsigned int reason, const z_arch_esf_t *esf) {
56-
s_save_crash_info.valid = true;
57-
s_save_crash_info.reason = reason;
58-
s_save_crash_info.esf = *esf;
59-
}
60-
#endif
61-
6244
void __wrap_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf) {
45+
// flush logs prior to capturing coredump & rebooting
46+
LOG_PANIC();
47+
6348
const struct __extra_esf_info *extra_info = &esf->extra_info;
6449
const _callee_saved_t *callee_regs = extra_info->callee;
6550

@@ -82,37 +67,14 @@ void __wrap_z_fatal_error(unsigned int reason, const z_arch_esf_t *esf) {
8267
.exc_return = exc_return,
8368
};
8469

85-
#if CONFIG_MEMFAULT_ZEPHYR_FATAL_HANDLER
86-
prv_save_crash_info(reason, esf);
87-
#endif
88-
8970
memfault_fault_handler(&reg, kMfltRebootReason_HardFault);
9071
}
9172

92-
#if CONFIG_MEMFAULT_ZEPHYR_FATAL_HANDLER
93-
void memfault_zephyr_z_fatal_error(void) {
94-
if (s_save_crash_info.valid) {
95-
unsigned int reason = K_ERR_KERNEL_OOPS;
96-
z_arch_esf_t *esf = NULL;
97-
if (s_save_crash_info.valid) {
98-
reason = s_save_crash_info.reason;
99-
esf = &s_save_crash_info.esf;
100-
}
101-
102-
__real_z_fatal_error(reason, esf);
103-
}
104-
}
105-
#endif
106-
10773
MEMFAULT_WEAK
10874
MEMFAULT_NORETURN
10975
void memfault_platform_reboot(void) {
11076
memfault_platform_halt_if_debugging();
11177

112-
#if CONFIG_MEMFAULT_ZEPHYR_FATAL_HANDLER
113-
memfault_zephyr_z_fatal_error();
114-
#endif
115-
11678
sys_arch_reboot(0);
11779
CODE_UNREACHABLE;
11880
}

scripts/mflt-build-id/poetry.lock

Lines changed: 20 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/mflt-build-id/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pyelftools = ">=0.26,<=0.28"
1919
pytest = "^6"
2020
pytest-cov = "^2"
2121
pytest-timeout = "^2.0"
22-
snapshottest = "1.0.0a0"
22+
snapshottest = {git = "https://github.com/memfault/snapshottest.git", rev = "1.0.0a0+memfault0"}
2323
wasmer = "0.3.0"
2424

2525
[tool.black]

0 commit comments

Comments
 (0)