Skip to content

Commit b7d5c1c

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.8.1 (Build 7582)
1 parent 4cbf8f4 commit b7d5c1c

30 files changed

+668
-28
lines changed

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,64 @@ 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.8.1] - 2024-04-24
10+
11+
### :chart_with_upwards_trend: Improvements
12+
13+
- General:
14+
15+
- A new platform function, `memfault_platform_metrics_connectivity_boot()`,
16+
can be enabled to be called from the Memfault SDK `metrics_boot()` function
17+
after the metrics subsystem is initialized. This platform function is used
18+
for setting any initial state information for Connectivity metrics, and has
19+
default implementations for ESP-IDF (WiFi) and nRF9160 (LTE) devices.
20+
21+
- ESP-IDF:
22+
23+
- Add a new Kconfig setting,
24+
`CONFIG_MEMFAULT_COREDUMP_STORAGE_WRITE_OFFSET_SECTORS`, which can be used
25+
to set an offset into the coredump storage area where coredumps are written.
26+
The full partition will still be erased, but coredumps will be written
27+
starting at the sector offset selected with this setting. The skipped sector
28+
will remain at the erased value, `0xff` for all bytes.
29+
30+
- Zephyr:
31+
32+
- Added a built-in weakly defined implementation of
33+
`memfault_platform_get_device_info()`, which provides:
34+
35+
- `.device_serial` : A default device serial based on the SOC's unique ID
36+
registers, via the
37+
[`hwinfo` subsystem](https://docs.zephyrproject.org/3.6.0/hardware/peripherals/hwinfo.html).
38+
This is the default device serial when `CONFIG_HWINFO=y`. If
39+
`CONFIG_HWINFO=n`, the fallback device serial is
40+
`CONFIG_SOC "-testserial"`.
41+
- `.software_type` : Configurable with
42+
`CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_TYPE`, defaults to `"app"`
43+
- `.software_version` : Configurable with
44+
`CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_VERSION`. Defaults to an
45+
identifier based on the `VERSION` file in the application, using the
46+
Zephyr
47+
[Application Version](https://docs.zephyrproject.org/3.6.0/build/version/index.html)
48+
feature, or `"0.0.0"` if unavailable.
49+
- `.hardware_version` : Configurable with
50+
`CONFIG_MEMFAULT_BUILTIN_DEVICE_INFO_HARDWARE_VERSION`. Defaults to an
51+
identifier based on `CONFIG_BOARD` and `CONFIG_BOARD_REVISION` (if set).
52+
53+
- Add a new Zephyr example app for the
54+
[ST NUCLEO-WBA55CG board](https://docs.zephyrproject.org/3.6.0/boards/st/nucleo_wba55cg/doc/nucleo_wba55cg.html),
55+
under [`examples/zephyr/nucleo_wba55cg`](examples/zephyr/nucleo_wba55cg).
56+
This example demonstrates the Memfault SDK integration on the NUCLEO-WBA55CG
57+
board.
58+
59+
- nRF-Connect SDK:
60+
61+
- Add [Connected Time Vital](https://mflt.io/connectivity-metrics)
62+
out-of-the-box for nRF9160 projects, tracking modem connected time. This is
63+
controlled with the Kconfig
64+
`CONFIG_MEMFAULT_NRF_CONNECTIVITY_CONNECTED_TIME_NRF91X`, enabled by
65+
default.
66+
967
## [1.8.0] - 2024-04-17
1068

1169
### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 7456
2-
GIT COMMIT: 69ebc0be9a
3-
VERSION: 1.8.0
1+
BUILD ID: 7582
2+
GIT COMMIT: ece044b45b
3+
VERSION: 1.8.1

components/include/memfault/core/reboot_reason_types.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ typedef enum MfltResetReason {
108108
// executing from a fault handler.
109109
kMfltRebootReason_Lockup = 0x9401,
110110

111+
// A reset triggered due to a security violation
112+
kMfltRebootReason_SecurityViolation = 0x9402,
113+
114+
// A reset triggered due to a parity error (i.e. memory integrity check)
115+
kMfltRebootReason_ParityError = 0x9403,
116+
117+
// A reset triggered due to a temperature error
118+
kMfltRebootReason_Temperature = 0x9404,
119+
120+
// A reset due to some other hardware error
121+
kMfltRebootReason_Hardware = 0x9405,
122+
111123
//
112124
// User Defined Unexpected Resets
113125
//

components/include/memfault/default_config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,16 @@ extern "C" {
653653
#define MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE 100
654654
#endif
655655

656+
//
657+
// Platform-specific metrics configuration options
658+
//
659+
660+
//! Enable this flag to cause metrics_boot() to call a platform-implemented
661+
//! memfault_platform_metrics_connectivity_boot() function
662+
#ifndef MEMFAULT_PLATFORM_METRICS_CONNECTIVITY_BOOT
663+
#define MEMFAULT_PLATFORM_METRICS_CONNECTIVITY_BOOT 0
664+
#endif
665+
656666
#ifdef __cplusplus
657667
}
658668
#endif
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
3+
//! @file
4+
//!
5+
//! Copyright (c) Memfault, Inc.
6+
//! See License.txt for details
7+
//!
8+
//! Copyright (c) Memfault, Inc.
9+
//! See License.txt for details
10+
//!
11+
//! @brief
12+
//! Optional platform-specific boot function for initializing connectivity metrics.
13+
14+
#include <stdbool.h>
15+
#include <stdint.h>
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
//! The platform must implement this function. It is called during boot to initialize
22+
//! platform-specific connectivity metrics.
23+
//!
24+
//! For example, this function may register handlers for connectivity events, which when
25+
//! received, the handlers will mark the begin and end of connection periods.
26+
void memfault_platform_metrics_connectivity_boot(void);
27+
28+
#ifdef __cplusplus
29+
}
30+
#endif

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

2525
#ifdef __cplusplus
2626
}

components/metrics/src/memfault_metrics.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "memfault/core/serializer_helper.h"
2121
#include "memfault/metrics/battery.h"
2222
#include "memfault/metrics/metrics.h"
23+
#include "memfault/metrics/platform/connectivity.h"
2324
#include "memfault/metrics/platform/overrides.h"
2425
#include "memfault/metrics/platform/timer.h"
2526
#include "memfault/metrics/reliability.h"
@@ -1272,5 +1273,9 @@ int memfault_metrics_boot(const sMemfaultEventStorageImpl *storage_impl,
12721273
return rv;
12731274
}
12741275

1276+
#if MEMFAULT_PLATFORM_METRICS_CONNECTIVITY_BOOT
1277+
memfault_platform_metrics_connectivity_boot();
1278+
#endif
1279+
12751280
return 0;
12761281
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.west
2+
/bootloader
3+
/build
4+
/modules
5+
/tools
6+
/zephyr
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Memfault Zephyr `nucleo_wba55cg` Example Application
2+
3+
This folder contains an example integration of the Memfault SDK using the port
4+
provided in `ports/zephyr`
5+
6+
The demo was tested using the
7+
[ST NUCLEO-WBA55CG board](https://docs.zephyrproject.org/3.6.0/boards/st/nucleo_wba55cg/doc/nucleo_wba55cg.html).
8+
9+
### Prerequisite
10+
11+
We assume you already have a working Zephyr toolchain installed locally.
12+
Step-by-step instructions can be found in the
13+
[Zephyr Documentation](https://docs.zephyrproject.org/2.5.0/getting_started/index.html#build-hello-world).
14+
15+
### Setup
16+
17+
From a Zephyr-enabled shell environment (`west` tool is available), initialize
18+
the workspace:
19+
20+
```bash
21+
west init -l memfault_demo_app
22+
west update
23+
west blobs fetch stm32
24+
```
25+
26+
### Building
27+
28+
```bash
29+
west build --board nucleo_wba55cg memfault_demo_app
30+
[...]
31+
[271/271] Linking C executable zephyr/zephyr.elf
32+
```
33+
34+
### Flashing
35+
36+
The build can be flashed on the development board using `west flash` ( See
37+
Zephyr
38+
["Building, Flashing, & Debugging" documentation](https://docs.zephyrproject.org/3.6.0/guides/west/build-flash-debug.html?highlight=building%20flashing#flashing-west-flash))
39+
40+
The default runner is `STM32_Programmer_CLI`, which must be available on `PATH`
41+
when running `west flash`. `STM32_Programmer_CLI` is installed
42+
[standalone](https://www.st.com/en/development-tools/stm32cubeprog.html) or from
43+
the STM32CubeIDE installation.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.13.1)
2+
3+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
4+
project(memfault_demo_app)
5+
6+
zephyr_include_directories(config)
7+
target_sources(app PRIVATE src/main.c)

0 commit comments

Comments
 (0)