Skip to content

Commit 9f19c8c

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.2.1 (Build 3382)
1 parent dfffeb4 commit 9f19c8c

File tree

9 files changed

+73
-20
lines changed

9 files changed

+73
-20
lines changed

CHANGES.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### Changes between Memfault SDK 1.2.0 and 1.2.1 - Sept 1, 2023
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- ESP-IDF:
6+
- Add a `heartbeat` cli command to the ESP-IDF port that does the same thing
7+
as in Memfault's default demo console + Zephyr's console.
8+
- Zephyr:
9+
- Add a new Kconfig option to the Zephyr port,
10+
`CONFIG_MEMFAULT_PLATFORM_EXTRA_CONFIG_FILE=y`, which causes
11+
`memfault_platform_config_extra.h` to be included in platform
12+
configurations. This can be utilized by a third party consumer of Zephyr to
13+
more easily extend the platform configurations set by Zephyr and avoid
14+
potentially losing a user's platform configurations set in
15+
`memfault_platform_config.h`, which
16+
[happened in the nRF Connect SDK recently](https://devzone.nordicsemi.com/f/nordic-q-a/103188/memfault-sdk-integration-missing-user-memfault_platform_config).
17+
118
### Changes between Memfault SDK 1.1.3 and 1.2.0 - Aug 30, 2023
219

320
#### :chart_with_upwards_trend: Improvements
@@ -6,14 +23,24 @@
623
- Eliminate several build warnings for our example app
724
- FreeRTOS:
825
- Fix a build error in our QEMU example when building on macOS
26+
- Modus Toolbox:
27+
- Update port to handle user override of SDK configs, metrics, trace_reasons,
28+
etc
29+
- Update port to fix errors when disabling built-in WiFi metrics
930
- nRF Connect SDK:
1031
- Enable mcuboot & NCS 1.4 with our example apps
1132
- Silicon Labs:
12-
- Add a demo CLI component for the emblib port. Check out our [Simplicity Studio example app](https://github.com/memfault/simplicity-studio-example) for usage
33+
- Add a demo CLI component for the emblib port. Check out our
34+
[Simplicity Studio example app](https://github.com/memfault/simplicity-studio-example)
35+
for usage
1336
- Fix a build warning in emblib port flash storage (MSC) module
1437
- Zephyr:
15-
- Fix a :bug: when building with LOG_MODE_DEFERRED that prevent log messages from flushing during a coredump
16-
- Fix a :bug: and warnings involving older Zephyr header paths. Resolves [#62](https://github.com/memfault/memfault-firmware-sdk/issues/62) and [#57](https://github.com/memfault/memfault-firmware-sdk/issues/57). Thanks @JordanYates and @YHusain1 for reporting these issues.
38+
- Fix a :bug: when building with LOG_MODE_DEFERRED that prevent log messages
39+
from flushing during a coredump
40+
- Fix a :bug: and warnings involving older Zephyr header paths. Resolves
41+
[#62](https://github.com/memfault/memfault-firmware-sdk/issues/62) and
42+
[#57](https://github.com/memfault/memfault-firmware-sdk/issues/57). Thanks
43+
@JordanYates and @YHusain1 for reporting these issues.
1744

1845
### Changes between Memfault SDK 1.1.2 and 1.1.3 - Aug 8, 2023
1946

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 3361
2-
GIT COMMIT: d427c1e05
1+
BUILD ID: 3382
2+
GIT COMMIT: b1e62a17a

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 = 2, .patch = 0 }
23-
#define MEMFAULT_SDK_VERSION_STR "1.2.0"
22+
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 2, .patch = 1 }
23+
#define MEMFAULT_SDK_VERSION_STR "1.2.1"
2424

2525
#ifdef __cplusplus
2626
}

components/metrics/src/memfault_metrics.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -814,29 +814,29 @@ static bool prv_heartbeat_debug_print(MEMFAULT_UNUSED void *ctx,
814814

815815
switch (metric_info->type) {
816816
case kMemfaultMetricType_Timer:
817-
MEMFAULT_LOG_DEBUG(" %s: %" PRIu32, key_name, value->u32);
817+
MEMFAULT_LOG_INFO(" %s: %" PRIu32, key_name, value->u32);
818818
break;
819819
case kMemfaultMetricType_Unsigned:
820820
if (metric_info->is_set) {
821-
MEMFAULT_LOG_DEBUG(" %s: %" PRIu32, key_name, value->u32);
821+
MEMFAULT_LOG_INFO(" %s: %" PRIu32, key_name, value->u32);
822822
} else {
823-
MEMFAULT_LOG_DEBUG(" %s: null", key_name);
823+
MEMFAULT_LOG_INFO(" %s: null", key_name);
824824
}
825825
break;
826826
case kMemfaultMetricType_Signed:
827827
if (metric_info->is_set) {
828-
MEMFAULT_LOG_DEBUG(" %s: %" PRIi32, key_name, value->i32);
828+
MEMFAULT_LOG_INFO(" %s: %" PRIi32, key_name, value->i32);
829829
} else {
830-
MEMFAULT_LOG_DEBUG(" %s: null", key_name);
830+
MEMFAULT_LOG_INFO(" %s: null", key_name);
831831
}
832832
break;
833833
case kMemfaultMetricType_String:
834-
MEMFAULT_LOG_DEBUG(" %s: \"%s\"", key_name, (const char *)value->ptr);
834+
MEMFAULT_LOG_INFO(" %s: \"%s\"", key_name, (const char *)value->ptr);
835835
break;
836836

837837
case kMemfaultMetricType_NumTypes: // To silence -Wswitch-enum
838838
default:
839-
MEMFAULT_LOG_DEBUG(" %s: <unknown type>", key_name);
839+
MEMFAULT_LOG_INFO(" %s: <unknown type>", key_name);
840840
break;
841841
}
842842

@@ -845,7 +845,7 @@ static bool prv_heartbeat_debug_print(MEMFAULT_UNUSED void *ctx,
845845

846846
void memfault_metrics_heartbeat_debug_print(void) {
847847
prv_heartbeat_timer_update();
848-
MEMFAULT_LOG_DEBUG("Heartbeat keys/values:");
848+
MEMFAULT_LOG_INFO("Heartbeat keys/values:");
849849
memfault_metrics_heartbeat_iterate(prv_heartbeat_debug_print, NULL);
850850
}
851851

ports/esp_idf/memfault/common/memfault_platform_demo_cli_cmds.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ static int prv_esp32_crash_example(int argc, char** argv) {
167167
return 0;
168168
}
169169

170+
static int prv_esp32_memfault_heartbeat(int argc, char **argv) {
171+
memfault_metrics_heartbeat_debug_trigger();
172+
return 0;
173+
}
174+
170175
static int prv_esp32_memfault_heartbeat_dump(int argc, char** argv) {
171176
memfault_metrics_heartbeat_debug_print();
172177
return 0;
@@ -311,6 +316,13 @@ void memfault_register_cli(void) {
311316
.func = prv_chunk_data_export,
312317
}));
313318

319+
ESP_ERROR_CHECK(esp_console_cmd_register(&(esp_console_cmd_t){
320+
.command = "heartbeat",
321+
.help = "trigger an immediate capture of all heartbeat metrics",
322+
.hint = NULL,
323+
.func = prv_esp32_memfault_heartbeat,
324+
}));
325+
314326
ESP_ERROR_CHECK( esp_console_cmd_register(&(esp_console_cmd_t) {
315327
.command = "heartbeat_dump",
316328
.help = "Dump current Memfault metrics heartbeat state",

ports/esp_idf/memfault/common/memfault_platform_http_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ int memfault_esp_port_http_client_post_data(void) {
420420

421421
// Check for data available first as nothing else matters if not.
422422
if (!memfault_esp_port_data_available()) {
423+
MEMFAULT_LOG_INFO("No new data found");
423424
return 0;
424425
}
425426

ports/zephyr/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,14 @@ config MEMFAULT_CATCH_ZEPHYR_ASSERT
376376
from __ASSERT() macro call sites, unless assert_post_action() contains
377377
a MEMFAULT_ASSERT() invocation.
378378

379+
config MEMFAULT_PLATFORM_EXTRA_CONFIG_FILE
380+
bool "Enable inclusion of additional platform config file"
381+
default n
382+
help
383+
Enables inclusion of an additional platform config file,
384+
'memfault_platform_config_extra.h'. This can be useful for third party
385+
libraries that want to include additional default platform configs.
386+
379387
menuconfig MEMFAULT_USE_GNU_BUILD_ID
380388
default y
381389
bool "Use a GNU build ID in an image"

ports/zephyr/config/memfault_zephyr_platform_config.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ extern "C" {
7474

7575
#endif /* CONFIG_MEMFAULT_USER_CONFIG_SILENT_FAIL */
7676

77-
#else
77+
#else /* ! CONFIG_MEMFAULT_USER_CONFIG_ENABLE */
7878
#define MEMFAULT_DISABLE_USER_TRACE_REASONS 1
79+
#endif /* CONFIG_MEMFAULT_USER_CONFIG_ENABLE */
80+
81+
// Pick up any extra configuration settings
82+
#if defined(CONFIG_MEMFAULT_PLATFORM_EXTRA_CONFIG_FILE)
83+
#include "memfault_platform_config_extra.h"
7984
#endif
8085

8186
#ifdef __cplusplus

tests/src/test_memfault_heartbeat_metrics_debug.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
109109
" test_key_timer: 0",
110110
" test_key_string: \"\"",
111111
};
112-
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_debug_print_on_boot,
112+
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Info, heartbeat_debug_print_on_boot,
113113
MEMFAULT_ARRAY_SIZE(heartbeat_debug_print_on_boot));
114114
memfault_metrics_heartbeat_debug_print();
115115
mock().checkExpectations();
@@ -130,7 +130,7 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
130130
" test_key_timer: 5000",
131131
" test_key_string: \"heyo!\"",
132132
};
133-
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_debug_print_after_collected,
133+
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Info, heartbeat_debug_print_after_collected,
134134
MEMFAULT_ARRAY_SIZE(heartbeat_debug_print_after_collected));
135135
mock().expectOneCall("memfault_metrics_heartbeat_serialize");
136136
memfault_metrics_heartbeat_debug_trigger();
@@ -148,7 +148,7 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
148148
" test_key_timer: 0",
149149
" test_key_string: \"\"",
150150
};
151-
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_debug_print_reset,
151+
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Info, heartbeat_debug_print_reset,
152152
MEMFAULT_ARRAY_SIZE(heartbeat_debug_print_reset));
153153
memfault_metrics_heartbeat_debug_print();
154154
mock().checkExpectations();
@@ -166,7 +166,7 @@ TEST(MemfaultHeartbeatMetricsDebug, Test_DebugPrints) {
166166
" test_key_timer: 0",
167167
" test_key_string: \"\"",
168168
};
169-
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Debug, heartbeat_add_non_null,
169+
prv_debug_print_expectations(kMemfaultPlatformLogLevel_Info, heartbeat_add_non_null,
170170
MEMFAULT_ARRAY_SIZE(heartbeat_add_non_null));
171171
// call add on this metric alone and confirm it is set
172172
memfault_metrics_heartbeat_add(MEMFAULT_METRICS_KEY(test_key_unsigned), 123);

0 commit comments

Comments
 (0)