Skip to content

Commit 26ed15e

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.23.0 (Build 13619)
1 parent 989d8ba commit 26ed15e

File tree

57 files changed

+592
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+592
-221
lines changed

.clang-format

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
# Please keep each property in alphabetical order to help compare between the other .clang-format
2-
# files.
3-
# This file is used by code editor formatting plugins
41
---
52
BasedOnStyle: Google
6-
---
7-
Language: Cpp
83

94
AlignArrayOfStructures: None
105
AllowShortBlocksOnASingleLine: Empty
116
AllowShortFunctionsOnASingleLine: Empty
127
AlwaysBreakBeforeMultilineStrings: false
138
AttributeMacros:
14-
- 'MEMFAULT_PACKED'
15-
- 'MEMFAULT_PACKED_STRUCT'
16-
- 'MEMFAULT_NORETURN'
17-
- 'MEMFAULT_NAKED_FUNC'
18-
- 'MEMFAULT_UNREACHABLE'
19-
- 'MEMFAULT_NO_OPT'
20-
- 'MEMFAULT_ALIGNED'
21-
- 'MEMFAULT_UNUSED'
22-
- 'MEMFAULT_USED'
23-
- 'MEMFAULT_WEAK'
24-
- 'MEMFAULT_PRINTF_LIKE_FUNC'
25-
- 'MEMFAULT_PUT_IN_SECTION'
9+
- MEMFAULT_ALIGNED
10+
- MEMFAULT_NAKED_FUNC
11+
- MEMFAULT_NO_ALLOC
12+
- MEMFAULT_NO_OPT
13+
- MEMFAULT_NORETURN
14+
- MEMFAULT_PACKED
15+
- MEMFAULT_PACKED_STRUCT
16+
- MEMFAULT_PRINTF_LIKE_FUNC
17+
- MEMFAULT_PUT_IN_SECTION
18+
- MEMFAULT_UNREACHABLE
19+
- MEMFAULT_UNUSED
20+
- MEMFAULT_USED
21+
- MEMFAULT_WEAK
2622
BitFieldColonSpacing: None
2723
BreakBeforeBinaryOperators: None
2824
BreakBeforeTernaryOperators: false
@@ -32,17 +28,16 @@ Cpp11BracedListStyle: false
3228
DerivePointerAlignment: false
3329
FixNamespaceComments: false
3430
ForEachMacros:
35-
- 'MEMFAULT_SHELL_FOR_EACH_COMMAND'
31+
- MEMFAULT_SHELL_FOR_EACH_COMMAND
3632
IndentPPDirectives: BeforeHash
3733
IndentWidth: 2
3834
NamespaceIndentation: All
3935
NamespaceMacros:
40-
- 'TEST_GROUP'
41-
- 'TEST'
36+
- TEST
37+
- TEST_GROUP
4238
PointerAlignment: Right
4339
SpaceInEmptyBlock: true
4440
WhitespaceSensitiveMacros:
45-
- 'MEMFAULT_ZEPHYR_INCLUDE'
46-
- 'MEMFAULT_QUOTE'
47-
- 'Pragma'
48-
...
41+
- MEMFAULT_QUOTE
42+
- MEMFAULT_ZEPHYR_INCLUDE
43+
- Pragma

.cyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ports/nxp
1818
ports/particle
1919
ports/qp
2020
ports/s32sdk
21+
ports/silabs
2122
ports/stm32cube
2223
ports/templates
2324
ports/zephyr

CHANGELOG.md

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,89 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.23.0] - 2024-04-16
10+
11+
### 📈 Added
12+
13+
- General:
14+
15+
- Improved support for run time tracking on FreeRTOS kernel version v11 and
16+
later, by adding compile-time checks for possible configuration issues.
17+
18+
- Add reboot reason decoding for the NXP RW61x chip series, using the
19+
`PMU.SYS_RST_STATUS` register to determine the reset reason. Add the file at
20+
[`ports/nxp/rw61x/pmu_reboot_tracking.c`](ports/nxp/rw61x/pmu_reboot_tracking.c)
21+
to your project to make use of it!
22+
23+
- Add reboot reason decoding for the SiLabs SiWx91x chip series. This
24+
implementation supports `Power On Reset`, `Pin Reset`, and `Software Reset`
25+
causes only. Please [reach out](mflt.io/support) if you are interested in
26+
other reset reasons. Add the file at
27+
[`sdk/embedded/ports/silabs/wiseconnect/siwx91x/siwx91x_reboot_tracking.c`](ports/silabs/wiseconnect/siwx91x/siwx91x_reboot_tracking.c)
28+
to your project to make use of it.
29+
30+
- Add an
31+
[implementation of `memfault_reboot_reason_get()`](ports/stm32cube/h5/rcc_reboot_tracking.c)
32+
for the STM32H5xx series of MCUs, using the `RCC-RSR` register to determine
33+
the reset reason. Add the file to your project to make use of it!
34+
35+
- ESP-IDF:
36+
37+
- Add 2 new out-of-box metrics:
38+
39+
- `spi_flash_chip_id` : the 24-bit RDID value of the SPI flash chip, for
40+
example `"c84017"` = GigaDevice GD25Q64 8MiB
41+
- `esp_chip_revision` : the ESP32 chip and revision, for example
42+
`esp32c6-0.0` or `esp32s3-0.2`
43+
44+
- For ESP-IDF v5.5 and later, enable `-ggdb3` by default for enhanced
45+
debugging. This is controlled with the Kconfig `CONFIG_MEMFAULT_GGDB3`.
46+
47+
- Set the User-Agent to `MemfaultSDK/<version>` when sending HTTP requests to
48+
Memfault.
49+
50+
### 🛠️ Changed
51+
52+
- General:
53+
54+
- Updated the internally used `clang-format` version to 20.1.0, latest at time
55+
of writing. This resulted in a few minor format changes in the SDK.
56+
57+
- Zephyr:
58+
59+
- Update the [Zephyr QEMU example](examples/zephyr/qemu) to use the latest
60+
Zephyr version, v4.1.0.
61+
62+
- nRF-Connect SDK:
63+
64+
- Update the [nRF-Connect SDK examples](examples/nrf-connect-sdk) to use the
65+
latest nRF-Connect SDK version, v2.9.1.
66+
67+
- Update the [nRF91 example](examples/nrf-connect-sdk/nrf9160) to enable the
68+
`DATETIME` subsystem, to tag SDK event and log data with timestamps once the
69+
network connection is activated.
70+
71+
- ESP-IDF:
72+
73+
- Update the `prv_panic_safe_putstr()` implementation to perform better on
74+
modern ESP-IDF versions (>=4.4.0). This function is used to output local
75+
prints during panic handling.
76+
77+
- Add a Kconfig `CONFIG_MEMFAULT_DATA_CHUNK_HANDLERS_CUSTOM` to allow
78+
overriding `memfault_esp_port_data_available()` and
79+
`memfault_esp_port_get_chunk()`. If other MCUs are forwarding data to an
80+
ESP32 for transport, enable this option and provide definitions to handle
81+
additional sources. By default, these functions only check the local device
82+
for available chunks.
83+
84+
### 🐛 Fixed
85+
86+
- ESP-IDF:
87+
88+
- Correctly print the initial delay and period in seconds for the periodic
89+
upload task. Previously, this info log print was using the value in
90+
milliseconds.
91+
992
## [1.22.0] - 2025-03-19
1093

1194
### 📈 Added
@@ -45,20 +128,12 @@ and this project adheres to
45128
- Log lines that are only a single `'\n'` character are no longer recorded in
46129
the Memfault Log Buffer.
47130

48-
### 🚩 Deprecated
49-
50-
### 🔥 Removed
51-
52-
### 🐛 Fixed
53-
54131
- Zephyr:
55132

56133
- The `hwinfo`-based Reset Reason implementation did not clear the reset
57134
reason register after reading the data. Updated to properly call
58135
`hwinfo_clear_reset_cause()` after reading the reset reason.
59136

60-
### 🔒 Security
61-
62137
## [1.21.1] - 2025-03-07
63138

64139
### 🐛 Fixed
@@ -344,7 +419,7 @@ and this project adheres to
344419
//! memory_main_pct_max, kMemfaultMetricType_Unsigned,
345420
//! CONFIG_MEMFAULT_METRICS_THREADS_MEMORY_SCALE_FACTOR
346421
//! )
347-
#include "memfault/ports/zephyr/thread_metrics.h"
422+
#include "memfault/ports/freertos/thread_metrics.h"
348423
MEMFAULT_METRICS_DEFINE_THREAD_METRICS (
349424
// monitor the main thread stack usage
350425
{

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 13216
2-
GIT COMMIT: fd0102e4c8
3-
VERSION: 1.22.0
1+
BUILD ID: 13619
2+
GIT COMMIT: 5cd404d7f3
3+
VERSION: 1.23.0

components/core/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ firmware and hardware versions (with fallbacks to hard-coded values, i.e.
1515
`"xyz-main"` as software type `"1.0.0"` as software version and `"xyz-proto"` as
1616
hardware version).
1717

18-
[To learn more about the concepts software type, software version, hardware version, etc. take a look at this documentation](https://mflt.io/36NGGgi).
18+
[To learn more about the concepts of software type, software version, hardware version, etc. take a look at this documentation](https://mflt.io/36NGGgi).
1919

2020
Please change `memfault_platform_device_info.c` in ways that makes sense for
2121
your project.
@@ -41,12 +41,15 @@ your project.
4141

4242
### Storage allocations
4343

44-
- `memfault_events_storage_boot()` to reserve storage for events.
44+
- `memfault_events_storage_boot()` to reserve storage for events (reboots, trace
45+
events, heartbeats)
46+
4547
- `memfault_reboot_tracking_boot()` points to a memory region that is not
4648
touched by any firmware except for reboot tracking API functions. Reboot info
4749
can be pushed to the event storage for packetization to be sent to Memfault.
4850

49-
# `memfault_trace_event_boot()`: not an allocation but connects a trace event context into the event storage allocation.
51+
- _`memfault_trace_event_boot()`_ not an allocation but connects a trace event
52+
context into the event storage allocation.
5053

5154
- `memfault_log_boot()` to reserve storage for the logging module. The logging
5255
storage gets sent to Memfault as part of the core dump data if enabled.

components/core/src/memfault_ram_reboot_info_tracking.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
MEMFAULT_STATIC_ASSERT(sizeof(sMfltRebootInfo) == MEMFAULT_REBOOT_TRACKING_REGION_SIZE,
4242
"struct doesn't match expected size");
4343

44+
MEMFAULT_STATIC_ASSERT(sizeof(sMfltRebootInfo) % 4 == 0, "struct size must be multiple of 4");
45+
4446
MEMFAULT_STATIC_ASSERT(sizeof(eMemfaultRebootReason) <=
4547
sizeof(((sMfltRebootInfo){ 0 }).last_reboot_reason),
4648
"enum does not fit within sMfltRebootInfo.last_reboot_reason");

components/include/memfault/core/compact_log_helpers.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,10 @@ extern "C" {
251251

252252
//! The metadata we track in the ELF for each compact log in the code.
253253
//! This is used to recover the original information
254-
#define MEMFAULT_LOG_FMT_ELF_SECTION_ENTRY(format, ...) \
255-
MEMFAULT_LOG_FMT_ELF_SECTION \
256-
MEMFAULT_NO_ALLOC \
257-
static const char _memfault_log_fmt_ptr[] = MEMFAULT_EXPAND_AND_QUOTE( \
258-
MEMFAULT_ARG_COUNT_UP_TO_32(__VA_ARGS__)) ";" __FILE__ \
254+
#define MEMFAULT_LOG_FMT_ELF_SECTION_ENTRY(format, ...) \
255+
MEMFAULT_LOG_FMT_ELF_SECTION \
256+
MEMFAULT_NO_ALLOC static const char _memfault_log_fmt_ptr[] = MEMFAULT_EXPAND_AND_QUOTE( \
257+
MEMFAULT_ARG_COUNT_UP_TO_32(__VA_ARGS__)) ";" __FILE__ \
259258
";" MEMFAULT_EXPAND_AND_QUOTE(__LINE__) ";" format
260259
261260
#define MEMFAULT_LOG_FMT_ELF_SECTION_ENTRY_PTR ((uint32_t)(uintptr_t)&_memfault_log_fmt_ptr[0])

components/include/memfault/core/log.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ extern void memfault_log_handle_saved_callback(void);
211211
//! Formats the provided string and saves it to backing storage
212212
//!
213213
//! @note: Should only be called via MEMFAULT_LOG_SAVE macro
214-
MEMFAULT_PRINTF_LIKE_FUNC(2, 3)
215-
void memfault_log_save(eMemfaultPlatformLogLevel level, const char *fmt, ...);
214+
MEMFAULT_PRINTF_LIKE_FUNC(2, 3) void memfault_log_save(eMemfaultPlatformLogLevel level,
215+
const char *fmt, ...);
216216

217217
//! Formats the provided string from a variable argument list
218218
//!
219219
//! @note Prefer saving logs via MEMFAULT_LOG_SAVE() when possible
220-
MEMFAULT_PRINTF_LIKE_FUNC(2, 0)
221-
void memfault_vlog_save(eMemfaultPlatformLogLevel level, const char *fmt, va_list args);
220+
MEMFAULT_PRINTF_LIKE_FUNC(2, 0) void memfault_vlog_save(eMemfaultPlatformLogLevel level,
221+
const char *fmt, va_list args);
222222

223223
//! Freezes the contents of the log buffer in preparation of uploading the logs to Memfault.
224224
//!

components/include/memfault/core/math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
#define MEMFAULT_MAX(a, b) (((a) > (b)) ? (a) : (b))
1919
#define MEMFAULT_FLOOR(a, align) (((a) / (align)) * (align))
2020
#define MEMFAULT_ABS(a) (((a) < 0) ? -(a) : (a))
21-
#define MEMFAULT_CEIL_DIV(x, y) (((x) + (y)-1) / (y))
21+
#define MEMFAULT_CEIL_DIV(x, y) (((x) + (y) - 1) / (y))
2222

2323
#ifdef __cplusplus
2424
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ typedef enum {
3333
//! @note it's expected that the implementation will terminate the log with a newline
3434
//! @note Even if there is no UART or RTT Console, it's worth considering adding a logging
3535
//! implementation that writes to RAM or flash which allows for post-mortem analysis
36-
MEMFAULT_PRINTF_LIKE_FUNC(2, 3)
37-
void memfault_platform_log(eMemfaultPlatformLogLevel level, const char *fmt, ...);
36+
MEMFAULT_PRINTF_LIKE_FUNC(2, 3) void memfault_platform_log(eMemfaultPlatformLogLevel level,
37+
const char *fmt, ...);
3838

3939
//! Routine for printing a log line as-is, only appending a newline, but without suffixing or
4040
//! appending timestamps, log level info, etc. This is used for debug console-commands where

components/include/memfault/core/trace_event_impl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ int memfault_trace_event_capture(eMfltTraceReasonUser reason, void *pc_addr, voi
2222
int memfault_trace_event_with_status_capture(eMfltTraceReasonUser reason, void *pc_addr,
2323
void *lr_addr, int32_t status);
2424

25-
MEMFAULT_PRINTF_LIKE_FUNC(4, 5)
26-
int memfault_trace_event_with_log_capture(eMfltTraceReasonUser reason, void *pc_addr, void *lr_addr,
27-
const char *fmt, ...);
25+
MEMFAULT_PRINTF_LIKE_FUNC(4, 5) int memfault_trace_event_with_log_capture(
26+
eMfltTraceReasonUser reason, void *pc_addr, void *lr_addr, const char *fmt, ...);
2827

2928
int memfault_trace_event_with_compact_log_capture(eMfltTraceReasonUser reason, void *lr_addr,
3029
uint32_t log_id, uint32_t fmt, ...);

components/include/memfault/metrics/ids_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ typedef struct {
139139

140140
#define MEMFAULT_METRICS_SESSION_KEY(key_name) kMfltMetricsSessionKey_##key_name
141141

142-
#define _MEMFAULT_METRICS_ID_CREATE(id, session_name) \
143-
{ kMfltMetricsIndex_##session_name##__##id }
142+
#define _MEMFAULT_METRICS_ID_CREATE(id, session_name) { kMfltMetricsIndex_##session_name##__##id }
144143

145144
#define _MEMFAULT_METRICS_ID(id, session_name) \
146145
((MemfaultMetricId){ kMfltMetricsIndex_##session_name##__##id })

components/include/memfault/version.h

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

2222
#define MEMFAULT_SDK_VERSION \
23-
{ .major = 1, .minor = 22, .patch = 0 }
24-
#define MEMFAULT_SDK_VERSION_STR "1.22.0"
23+
{ .major = 1, .minor = 23, .patch = 0 }
24+
#define MEMFAULT_SDK_VERSION_STR "1.23.0"
2525

2626
#ifdef __cplusplus
2727
}

components/panics/src/memfault_fault_handling_arm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ void MEMFAULT_ASSERT_TRAP(void) {
558558
// disable optimizations to fix
559559
MEMFAULT_NO_OPT
560560
#endif
561-
static void
562-
prv_fault_handling_assert(void *pc, void *lr, eMemfaultRebootReason reason) {
561+
static void
562+
prv_fault_handling_assert(void *pc, void *lr, eMemfaultRebootReason reason) {
563563
// Only set the crash reason if it's unset, in case we are in a nested assert
564564
if (s_crash_reason == kMfltRebootReason_Unknown) {
565565
sMfltRebootTrackingRegInfo info = {

examples/cypress/CY8CKIT-064S0S2-4343W/src/memfault_platform_port.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ void memfault_platform_log(eMemfaultPlatformLogLevel level, const char *fmt, ...
166166
printf("[%s] MFLT: %s\n", lvl_str, log_buf);
167167
}
168168

169-
MEMFAULT_PUT_IN_SECTION(".noinit.mflt_reboot_info")
170-
static uint8_t s_reboot_tracking[MEMFAULT_REBOOT_TRACKING_REGION_SIZE];
169+
MEMFAULT_PUT_IN_SECTION(".noinit.mflt_reboot_info") static uint8_t
170+
s_reboot_tracking[MEMFAULT_REBOOT_TRACKING_REGION_SIZE];
171171

172172
void memfault_platform_reboot_tracking_boot(void) {
173173
sResetBootupInfo reset_info = { 0 };

examples/cypress/CY8CKIT-064S0S2-4343W/src/mqtt_demo_memfault.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ int RunCoreMqttMemfaultDemo(bool awsIotMqttMode, const char *pIdentifier, void *
572572
if (isDemoSuccessful) {
573573
xDemoStatus = pdPASS;
574574
LogInfo(("Demo run successful."));
575-
for (;;)
576-
;
575+
for (;;);
577576
} else {
578577
xDemoStatus = pdFAIL;
579578
}

examples/dialog/da145xx/apps/memfault_demo_app/src/config/da1458x_config_advanced.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@
123123
/* - CFG_NVDS_TAG_BLE_CA_NB_PKT Number of packets to receive for statistics */
124124
/* - CFG_NVDS_TAG_BLE_CA_NB_BAD_PKT Number of bad packets needed to remove a channel */
125125
/****************************************************************************************************************/
126-
#define CFG_NVDS_TAG_BD_ADDRESS \
127-
{ 0x01, 0x00, 0x70, 0xCA, 0xEA, 0x80 }
126+
#define CFG_NVDS_TAG_BD_ADDRESS { 0x01, 0x00, 0x70, 0xCA, 0xEA, 0x80 }
128127

129128
#define CFG_NVDS_TAG_LPCLK_DRIFT DRIFT_500PPM
130129
#define CFG_NVDS_TAG_BLE_CA_TIMER_DUR 2000
@@ -368,8 +367,7 @@
368367
/* - CFG_NVDS_TAG_BLE_CA_NB_PKT Number of packets to receive for statistics */
369368
/* - CFG_NVDS_TAG_BLE_CA_NB_BAD_PKT Number of bad packets needed to remove a channel */
370369
/****************************************************************************************************************/
371-
#define CFG_NVDS_TAG_BD_ADDRESS \
372-
{ 0x01, 0x00, 0x70, 0xCA, 0xEA, 0x80 }
370+
#define CFG_NVDS_TAG_BD_ADDRESS { 0x01, 0x00, 0x70, 0xCA, 0xEA, 0x80 }
373371

374372
#define CFG_NVDS_TAG_LPCLK_DRIFT DRIFT_500PPM
375373
#define CFG_NVDS_TAG_BLE_CA_TIMER_DUR 2000

examples/dialog/da145xx/apps/memfault_demo_app/src/memfault_platform_device_info.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ void memfault_platform_get_device_info(sMemfaultDeviceInfo *info) {
3737
s_init = true;
3838
}
3939

40-
*info = (struct MemfaultDeviceInfo) {
41-
.device_serial = s_device_serial, .hardware_version = APP_DIS_HARD_REV_STR,
40+
*info = (struct MemfaultDeviceInfo){
41+
.device_serial = s_device_serial,
42+
.hardware_version = APP_DIS_HARD_REV_STR,
4243
.software_version = s_fw_version,
4344
#if defined(__DA14531__)
4445
.software_type = "da14531-demo-app",

examples/dialog/da145xx/apps/memfault_demo_app/src/platform/user_periph_setup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ void periph_init(void) {
124124
#else
125125
// Power up peripherals' power domain
126126
SetBits16(PMU_CTRL_REG, PERIPH_SLEEP, 0);
127-
while (!(GetWord16(SYS_STAT_REG) & PER_IS_UP))
128-
;
127+
while (!(GetWord16(SYS_STAT_REG) & PER_IS_UP));
129128
SetBits16(CLK_16M_REG, XTAL16_BIAS_SH_ENABLE, 1);
130129
#endif
131130

0 commit comments

Comments
 (0)