Skip to content

Commit 50f0e19

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.4.2 (Build 4292)
1 parent 6f7cc90 commit 50f0e19

File tree

11 files changed

+67
-14
lines changed

11 files changed

+67
-14
lines changed

CHANGES.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Memfault Firmware SDK Changelog
22

3+
## [1.4.2] - 2023-11-02
4+
5+
### :chart_with_upwards_trend: Improvements
6+
7+
- General:
8+
9+
- Improve the trace quality for asserts when using the IAR compiler and high
10+
optimization settings (`-Oh`)
11+
- Add demo CLI command to print the current values of heartbeat metrics. Try
12+
this out in your demo CLI implementation or with the built-in CLI with
13+
Zephyr!
14+
315
## [1.4.1] - 2023-10-31
416

5-
#### :rocket: New Features
17+
### :rocket: New Features
618

719
- ESP-IDF:
820

@@ -14,6 +26,8 @@
1426
- `heap_allocated_blocks_count`
1527
- `heap_min_free_bytes`
1628

29+
### :chart_with_upwards_trend: Improvements
30+
1731
- Zephyr:
1832

1933
- Enable capturing [Memfault-style compact logs](https://mflt.io/compact-logs)
@@ -47,7 +61,7 @@
4761

4862
## [1.4.0] - 2023-10-23
4963

50-
#### :rocket: New Features
64+
### :rocket: New Features
5165

5266
- ESP-IDF:
5367

@@ -174,7 +188,7 @@
174188
`__no_alloc` attribute to the compact log symbols, to have the IAR linker
175189
set the `NO_LOAD` attribute correctly on the compact log output section.
176190

177-
#### :boom: Breaking Changes
191+
### :boom: Breaking Changes
178192

179193
- ESP-IDF:
180194

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 4232
2-
GIT COMMIT: 3f7cda509f
3-
VERSION: 1.4.1
1+
BUILD ID: 4292
2+
GIT COMMIT: 7f46de743
3+
VERSION: 1.4.2

components/demo/src/memfault_demo_shell_commands.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "memfault/core/math.h"
1515
#include "memfault/demo/cli.h"
1616
#include "memfault/demo/shell_commands.h"
17+
#include "memfault/metrics/metrics.h"
1718

1819
static int prv_panics_component_required(void) {
1920
MEMFAULT_LOG_RAW("Disabled. panics component integration required");
@@ -41,6 +42,11 @@ int memfault_demo_cli_cmd_export(MEMFAULT_UNUSED int argc, MEMFAULT_UNUSED char
4142
return 0;
4243
}
4344

45+
int memfault_demo_cli_cmd_heartbeat_dump(MEMFAULT_UNUSED int argc, MEMFAULT_UNUSED char *argv[]) {
46+
memfault_metrics_heartbeat_debug_print();
47+
return 0;
48+
}
49+
4450
static const sMemfaultShellCommand s_memfault_shell_commands[] = {
4551
{"clear_core", memfault_demo_cli_cmd_clear_core, "Clear an existing coredump"},
4652
{"drain_chunks", memfault_demo_drain_chunk_data,
@@ -50,6 +56,8 @@ static const sMemfaultShellCommand s_memfault_shell_commands[] = {
5056
{"get_core", memfault_demo_cli_cmd_get_core, "Get coredump info"},
5157
{"get_device_info", memfault_demo_cli_cmd_get_device_info, "Get device info"},
5258
{"coredump_size", memfault_demo_cli_cmd_coredump_size, "Print the coredump storage capacity"},
59+
{"heartbeat_dump", memfault_demo_cli_cmd_heartbeat_dump,
60+
"Dump current Memfault metrics heartbeat state"},
5361
//
5462
// Test commands for validating SDK functionality: https://mflt.io/mcu-test-commands
5563
//

components/demo/src/panics/memfault_demo_panics.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ int memfault_demo_cli_cmd_assert(int argc, char *argv[]) {
127127
} else {
128128
MEMFAULT_ASSERT(0);
129129
}
130+
131+
return -1;
130132
}
131133

132134
#if MEMFAULT_COMPILER_ARM_CORTEX_M

components/include/memfault/core/platform/core.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ int memfault_platform_boot(void);
3333
//! Invoked after memfault fault handling has run.
3434
//!
3535
//! The platform should do any final cleanup and reboot the system
36-
MEMFAULT_NORETURN void memfault_platform_reboot(void);
36+
#if defined(__ICCARM__)
37+
//! IAR will optimize away link register stores from callsites which makes it
38+
//! impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
39+
#else
40+
MEMFAULT_NORETURN
41+
#endif
42+
void memfault_platform_reboot(void);
3743

3844
//! Invoked after faults occur so the user can debug locally if a debugger is attached
3945
void memfault_platform_halt_if_debugging(void);

components/include/memfault/demo/cli.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ void user_transport_send_chunk_data(void *chunk_data, size_t chunk_data_len);
111111
//! manually via the Chunks Debug in the UI.
112112
int memfault_demo_cli_cmd_export(int argc, char *argv[]);
113113

114+
//! Print current heartbeat metrics
115+
int memfault_demo_cli_cmd_heartbeat_dump(int argc, char *argv[]);
116+
114117
#ifdef __cplusplus
115118
}
116119
#endif

components/include/memfault/panics/fault_handling.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ MEMFAULT_NAKED_FUNC void MEMFAULT_EXC_HANDLER_WATCHDOG(void);
8282
//! @param lr The return address
8383
//! @see MEMFAULT_ASSERT_RECORD
8484
//! @see MEMFAULT_ASSERT
85-
#if defined(__CC_ARM) || (defined(__clang__) && defined(__ti__))
86-
//! ARMCC and tiarmclang will optimize away link register stores from callsites which makes it
85+
#if defined(__CC_ARM) || defined(__ICCARM__) || (defined(__clang__) && defined(__ti__))
86+
//! ARMCC, IAR, and tiarmclang will optimize away link register stores from callsites which makes it
8787
//! impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
8888
#else
8989
MEMFAULT_NORETURN
@@ -97,8 +97,8 @@ void memfault_fault_handling_assert(void *pc, void *lr);
9797
//! @param extra_info Additional information used by the assert handler
9898
//! @see MEMFAULT_ASSERT_RECORD
9999
//! @see MEMFAULT_ASSERT
100-
#if defined(__CC_ARM) || (defined(__clang__) && defined(__ti__))
101-
//! ARMCC and tiarmclang optimize away link register stores from callsites which makes it
100+
#if defined(__CC_ARM) || defined(__ICCARM__) || (defined(__clang__) && defined(__ti__))
101+
//! ARMCC, IAR, and tiarmclang optimize away link register stores from callsites which makes it
102102
//! impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
103103
#else
104104
MEMFAULT_NORETURN

components/include/memfault/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ typedef struct {
1919
uint8_t patch;
2020
} sMfltSdkVersion;
2121

22-
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 4, .patch = 1 }
23-
#define MEMFAULT_SDK_VERSION_STR "1.4.1"
22+
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 4, .patch = 2 }
23+
#define MEMFAULT_SDK_VERSION_STR "1.4.2"
2424

2525
#ifdef __cplusplus
2626
}

examples/esp32/apps/memfault_demo_app/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ if(DEFINED IDF_VERSION_MAJOR)
1515
endif()
1616
endif()
1717

18+
# Look for the Memfault SDK in a subdirectory first, when this app is used
19+
# standalone (not from within the Memfault SDK)
20+
get_filename_component(memfault_firmare_sdk_dir third-party/memfault-firmware-sdk ABSOLUTE)
21+
if(NOT EXISTS ${memfault_firmare_sdk_dir})
1822
get_filename_component(memfault_firmare_sdk_dir ../../../../ ABSOLUTE)
23+
endif()
1924
include(${memfault_firmare_sdk_dir}/ports/esp_idf/memfault.cmake)
2025

2126
# NOTE: This include also applies global compiler options, make sure

ports/zephyr/common/memfault_demo_cli.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ static int prv_trigger_heartbeat(const struct shell *shell, size_t argc, char **
157157
#endif
158158
}
159159

160+
static int prv_heartbeat_dump(const struct shell *shell, size_t argc, char **argv) {
161+
#if defined(CONFIG_MEMFAULT_METRICS)
162+
memfault_metrics_heartbeat_debug_print();
163+
#else
164+
shell_print(shell, "CONFIG_MEMFAULT_METRICS not enabled");
165+
#endif
166+
return 0;
167+
}
168+
160169
static int prv_test_reboot(const struct shell *shell, size_t argc, char **argv) {
161170
memfault_reboot_tracking_mark_reset_imminent(kMfltRebootReason_UserReset, NULL);
162171
memfault_platform_reboot();
@@ -280,6 +289,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
280289
prv_check_and_fetch_ota_payload_cmd),
281290
SHELL_CMD(coredump_size, NULL, "print coredump computed size and storage capacity",
282291
prv_coredump_size),
292+
SHELL_CMD(heartbeat_dump, NULL, "dump current Memfault metrics heartbeat state",
293+
prv_heartbeat_dump),
283294
SHELL_CMD(post_chunks, NULL, "Post Memfault data to cloud", prv_post_data),
284295
SHELL_CMD(test, &sub_memfault_crash_cmds,
285296
"commands to verify memfault data collection (https://mflt.io/mcu-test-commands)",

0 commit comments

Comments
 (0)