Skip to content

Commit a173d92

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.13.0 (Build 190095)
1 parent 1afdc3d commit a173d92

Some content is hidden

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

42 files changed

+960
-230
lines changed

CHANGES.md

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
### Changes between Memfault SDK 0.13.0 and SDK 0.12.0 - March 4, 2021
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- Improved documentation in [README](README.md) and [components](components/)
6+
directories.
7+
- Added coredump capture support to panics component for the AARCH64
8+
architecture.
9+
- Reference platform API implementations for the following MCUs/SDKs:
10+
- STM32WBxx family / STM32CubeWB:
11+
- [rich reboot reason info derived from RCC CSR register](ports/stm32cube/wb/rcc_reboot_tracking.c#L1)
12+
- nRF5 SDK
13+
- [app_timer based port for metric dependencies](ports/nrf5_sdk/memfault_platform_metrics.c#L1)
14+
- [`fw_build_id.py`](scripts/fw_build_id.py) script improvements
15+
- script is now compatible with Python2 environments.
16+
- Added new `--dump <chars>` option to simplify extraction of build id in
17+
automation, i.e:
18+
```
19+
python scripts/fw_build_id.py <ELF> --dump 7
20+
3a3e81f
21+
```
22+
23+
#### :house: Internal
24+
25+
- Started work to enable automatic capture of logs in a coredump for the Zephyr
26+
& nRF Connect SDK.
27+
28+
#### :boom: Breaking Changes
29+
30+
- If you were linking `memfault_nrf5_coredump.c` in your project:
31+
- the file has been split into `nrf5_coredump_regions.c` (which defines the
32+
regions to collect in a coredump) & `nrf5_coredump_storage.c` (which
33+
implements the port for saving coredumps to internal flash). Both of these
34+
files must be added to your build system.
35+
- Linker script names for region to save coredump to and regions to collect
36+
need to be updated:
37+
- Update`__CoreStart` & `__MemfaultCoreStorageEnd` to
38+
`__MemfaultCoreStorageStart` & `__MemfaultCoreStorageEnd` in linker
39+
script.
40+
- Update `__MfltCoredumpRamStart` & `__MfltCoredumpRamEnd` to
41+
`__MemfaultCoredumpRamStart` & `__MemfaultCoredumpRamEnd`
42+
143
### Changes between Memfault SDK 0.12.0 and SDK 0.11.4 - Feb 14, 2021
244
345
#### :chart_with_upwards_trend: Improvements
@@ -44,7 +86,7 @@
4486
both`CONFIG_USING_ESP_CONSOLE=n` and `CONFIG_MEMFAULT_CLI_ENABLED=n`
4587
- Added default implementations for `MEMFAULT_GET_LR()`, `MEMFAULT_GET_PC()`,
4688
and `MEMFAULT_BREAKPOINT()` to
47-
[`compiler_gcc.h`](components/core/include/memfault/core/compiler_gcc.h) to
89+
[`compiler_gcc.h`](components/include/memfault/core/compiler_gcc.h) to
4890
facilitate compilations of the SDK against other architectures.
4991

5092
### Changes between Memfault SDK 0.11.3 and SDK 0.11.2 - Jan 31, 2021
@@ -174,7 +216,7 @@
174216
#### :rocket: New Features
175217

176218
- Added several more
177-
[reboot reason options](components/core/include/memfault/core/reboot_reason_types.h#L16):
219+
[reboot reason options](components/include/memfault/core/reboot_reason_types.h#L16):
178220
- `kMfltRebootReason_PinReset` for explicitly tracking external pin resets.
179221
- `kMfltRebootReason_SoftwareWatchdog` & `kMfltRebootReason_HardwareWatchdog`
180222
for easier disambiguation between watchdog resets where a coredump was
@@ -241,7 +283,7 @@
241283
#### :chart_with_upwards_trend: Improvements
242284

243285
- A log can now be captured alongside a trace event by using a new API:
244-
[`MEMFAULT_TRACE_EVENT_WITH_LOG(reason, ...)`](components/core/include/memfault/core/trace_event.h#L77).
286+
[`MEMFAULT_TRACE_EVENT_WITH_LOG(reason, ...)`](components/include/memfault/core/trace_event.h#L77).
245287
This can be useful to capture arbitrary diagnostic data with an error event or
246288
to capture critical error logs that you would like to be alerted on when they
247289
happen. For example:
@@ -294,7 +336,7 @@ void record_temperature(void) {
294336
forwarding Memfault chunks to the ESP32.
295337
- The platform port for the memfault log dependency can now be implemented by
296338
macros (rather than the `memfault_platform_log` dependency). See
297-
[`components/core/include/memfault/core/debug_log.h`](components/core/include/memfault/core/debug_log.h)
339+
[`components/include/memfault/core/debug_log.h`](components/include/memfault/core/debug_log.h)
298340
for more details.
299341
300342
#### :boom: Breaking Changes
@@ -313,7 +355,7 @@ void record_temperature(void) {
313355
the memory regions requested take up more space than the platform storage
314356
allocated for saving. A warning will also be displayed in the Memfault UI when
315357
this happens. Regions are always read in the order returned from
316-
[`memfault_platform_coredump_get_regions()`](components/panics/include/memfault/panics/platform/coredump.h)
358+
[`memfault_platform_coredump_get_regions()`](components/include/memfault/panics/platform/coredump.h)
317359
so it is recommended to order this list from the most to least important
318360
regions to capture.
319361
- Updated FreeRTOS port to use static allocation APIs by default when the
@@ -324,7 +366,7 @@ void record_temperature(void) {
324366
#### :chart_with_upwards_trend: Improvements
325367
326368
- Added several more
327-
[reboot reason options](components/core/include/memfault/core/reboot_reason_types.h#L16):
369+
[reboot reason options](components/include/memfault/core/reboot_reason_types.h#L16):
328370
`kMfltRebootReason_SoftwareReset` & `kMfltRebootReason_DeepSleep`.
329371
- Extended [ESP32 port](https://mflt.io/esp-tutorial) to include integrations
330372
for [reboot reason tracking](https://mflt.io/reboot-reasons) and
@@ -337,7 +379,7 @@ void record_temperature(void) {
337379
#### :chart_with_upwards_trend: Improvements
338380
339381
- Added a new convenience API,
340-
[`memfault_coredump_storage_check_size()`](components/panics/include/memfault/panics/coredump.h),
382+
[`memfault_coredump_storage_check_size()`](components/include/memfault/panics/coredump.h),
341383
to check that coredump storage is appropriately sized.
342384
- Fixed a :bug: with heartbeat timers that would lead to an incorrect duration
343385
being reported if the timer was started and stopped within the same
@@ -365,8 +407,8 @@ void record_temperature(void) {
365407
[memfault_event_storage.c](components/core/src/memfault_event_storage.c#L30)
366408
- Added convenience API, `memfault_build_id_get_string`, for populating a buffer
367409
with a portion of the
368-
[Memfault Build ID](components/core/include/memfault/core/build_info.h#L8-L42)
369-
as a string.
410+
[Memfault Build ID](components/include/memfault/core/build_info.h#L8-L42) as a
411+
string.
370412
- Added default implementations of several Memfault SDK dependency functions
371413
when using FreeRTOS to [ports/freertos](ports/freertos).
372414
@@ -376,7 +418,7 @@ void record_temperature(void) {
376418
377419
- A status or error code (i.e bluetooth disconnect reason, errno value, etc) can
378420
now be logged alongside a trace event by using a new API:
379-
[`MEMFAULT_TRACE_EVENT_WITH_STATUS(reason, status_code)`](components/core/include/memfault/core/trace_event.h#L55).
421+
[`MEMFAULT_TRACE_EVENT_WITH_STATUS(reason, status_code)`](components/include/memfault/core/trace_event.h#L55).
380422
381423
### Changes between Memfault SDK 0.7.1 and SDK 0.7.0 - Sept 1, 2020
382424
@@ -389,7 +431,7 @@ void record_temperature(void) {
389431
paths within the SDK and leaves the NMI Handler free for other uses within the
390432
user's environment.
391433
- Added several more
392-
[reboot reason options](components/core/include/memfault/core/reboot_reason_types.h#L16):
434+
[reboot reason options](components/include/memfault/core/reboot_reason_types.h#L16):
393435
`kMfltRebootReason_PowerOnReset`, `kMfltRebootReason_BrownOutReset`, &
394436
`kMfltRebootReason_Nmi`.
395437
@@ -398,7 +440,7 @@ void record_temperature(void) {
398440
#### :chart_with_upwards_trend: Improvements
399441
400442
- Added utility to facilitate collection of the memory regions used by the
401-
[logging module](components/core/include/memfault/core/log.h) as part of a
443+
[logging module](components/include/memfault/core/log.h) as part of a
402444
coredump. With this change, when the SDK is compiled with
403445
`MEMFAULT_COREDUMP_COLLECT_LOG_REGIONS=1`, the logging region will
404446
automatically be collected as part of a coredump. Step-by-step details can
@@ -432,7 +474,7 @@ void record_temperature(void) {
432474
#### :rocket: New Features
433475
434476
- Added
435-
[memfault/core/data_export.h](components/core/include/memfault/core/data_export.h#L5)
477+
[memfault/core/data_export.h](components/include/memfault/core/data_export.h#L5)
436478
API to facilitate production and evaluation use cases where Memfault data is
437479
extracted over a log interface (i.e shell, uart console, log file, etc). See
438480
the header linked above or the
@@ -552,7 +594,7 @@ void record_temperature(void) {
552594

553595
- Added native SDK support for tracking and generating a unique firmware build
554596
id with any compiler! Quick integration steps can be found in
555-
[memfault/core/build_info.h](components/core/include/memfault/core/build_info.h#L8-L42).
597+
[memfault/core/build_info.h](components/include/memfault/core/build_info.h#L8-L42).
556598
It is very common, especially during development, to not change the firmware
557599
version between editing and compiling the code. This will lead to issues when
558600
recovering backtraces or symbol information because the debug information in
@@ -581,8 +623,8 @@ void record_temperature(void) {
581623
- `$(MEMFAULT_SDK_ROOT)/components/core/src/memfault_build_id.c`
582624
- `$(MEMFAULT_SDK_ROOT)/components/core/src/memfault_core_utils.c`
583625
- We also encourage you to add a
584-
[unique build id](components/core/include/memfault/core/build_info.h#L8-L42)
585-
to your build (several line code change).
626+
[unique build id](components/include/memfault/core/build_info.h#L8-L42) to
627+
your build (several line code change).
586628

587629
### Changes between Memfault SDK 0.4.0 and SDK 0.3.4 - May 6, 2020
588630

@@ -592,14 +634,14 @@ void record_temperature(void) {
592634
non-volatile storage mediums. This can be useful for devices which experience
593635
prolonged periods of no connectivity. To leverage the feature, an end user
594636
must implement the
595-
[nonvolatile_event_storage platform API](components/core/include/memfault/core/platform/nonvolatile_event_storage.h#L7).
637+
[nonvolatile_event_storage platform API](components/include/memfault/core/platform/nonvolatile_event_storage.h#L7).
596638

597639
#### :chart_with_upwards_trend: Improvements
598640

599641
- Added an assert used internally by the SDK which makes it easier to debug API
600642
misuse during bringup. The assert is enabled by default but can easily be
601643
disabled or overriden. For more details see
602-
[`memfault/core/sdk_assert.h`](components/core/include/memfault/core/sdk_assert.h#L6).
644+
[`memfault/core/sdk_assert.h`](components/include/memfault/core/sdk_assert.h#L6).
603645
- Added a default implementation of
604646
[`memfault_platform_halt_if_debugging()`](components/core/src/arch_arm_cortex_m.c#L20-L34)
605647
for Cortex-M targets. The function is defined as _weak_ so a user can still
@@ -655,7 +697,7 @@ void record_temperature(void) {
655697
#### :rocket: New Features
656698

657699
- The `captured_date` for an event can now be set by implementing
658-
[`memfault_platform_time_get_current()`](components/core/include/memfault/core/platform/system_time.h#L33).
700+
[`memfault_platform_time_get_current()`](components/include/memfault/core/platform/system_time.h#L33).
659701
If the API is not implemented, the `captured_date` will continue to be set
660702
based on the time the event was received by the memfault cloud.
661703

@@ -666,13 +708,13 @@ void record_temperature(void) {
666708
[NRF52 demo app](platforms/nrf5/libraries/memfault/platform_reference_impl/memfault_platform_reboot_tracking.c#L1)
667709
and a new `reboot` CLI command to easily exercise it.
668710
- A `reset_reason` can now optionally be provided as part of
669-
[`sResetBootupInfo`](components/panics/include/memfault/core/reboot_tracking.h#L41).
711+
[`sResetBootupInfo`](components/include/memfault/core/reboot_tracking.h#L41).
670712
This can be useful for scenarios where the reboot reason is known on bootup
671713
but could not be set prior to the device crashing.
672714
- A reboot reason event will now _always_ be generated when
673715
`memfault_reboot_tracking_boot()` is called even if no information about the
674716
reboot has been provided. In this scenario, the reset reason will be
675-
[`kMfltRebootReason_Unknown`](components/core/include/memfault/core/reboot_reason_types.h#L16)
717+
[`kMfltRebootReason_Unknown`](components/include/memfault/core/reboot_reason_types.h#L16)
676718

677719
#### :house: Internal
678720

@@ -695,8 +737,7 @@ void record_temperature(void) {
695737

696738
#### :rocket: New Features
697739

698-
- Added
699-
[`memfault_log_read()`](components/core/include/memfault/core/log.h#L95-L121)
740+
- Added [`memfault_log_read()`](components/include/memfault/core/log.h#L95-L121)
700741
API to make it possible to use the module to cache logs in RAM and then flush
701742
them out to slower mediums, such as a UART console or Flash, from a background
702743
task.
@@ -705,7 +746,7 @@ void record_temperature(void) {
705746

706747
- A pointer to the stack frame upon exception entry is now included in
707748
`sCoredumpCrashInfo` when
708-
[memfault_platform_coredump_get_regions](components/panics/include/memfault/panics/platform/coredump.h#L56)
749+
[memfault_platform_coredump_get_regions](components/include/memfault/panics/platform/coredump.h#L56)
709750
is invoked. This can (optionally) be used to configure regions collected based
710751
on the state or run platform specific cleanup based on the state.
711752
- Added Root Certificates needed for release downloads to
@@ -723,7 +764,7 @@ void record_temperature(void) {
723764
- Introduced a lightweight logging module. When used, the logs leading up to a
724765
crash will now be decoded and displayed from the Memfault Issue Details Web
725766
UI. For instructions about how to use the module in your project, check out
726-
[log.h](components/core/include/memfault/core/log.h).
767+
[log.h](components/include/memfault/core/log.h).
727768
- The metrics component will now automatically collect the elapsed time and the
728769
number of unexpected reboots during a heartbeat interval. The Memfault cloud
729770
now uses this information to automatically compute and display the overall
@@ -744,13 +785,12 @@ void record_temperature(void) {
744785
- The function signature for `memfault_metrics_boot()` changed as part of this
745786
update. If you are already using the `metrics` component, you will need to
746787
update the call accordingly. See the notes in
747-
[metrics.h](components/metrics/include/memfault/metrics/metrics.h) for more
748-
details.
788+
[metrics.h](components/include/memfault/metrics/metrics.h) for more details.
749789
- If you are _not_ using our CMake or Make
750790
[build system helpers](README.md#add-sources-to-build-system), you will need
751791
to add `$(MEMFAULT_SDK_ROOT)/components/core/src/memfault_log.c` to your
752792
project. (Note that until
753-
[`memfault_log_boot()`](https://github.com/memfault/memfault-firmware-sdk/blob/master/components/core/include/memfault/core/log.h#L33-L38)
793+
[`memfault_log_boot()`](https://github.com/memfault/memfault-firmware-sdk/blob/master/components/include/memfault/core/log.h#L33-L38)
754794
is called, all calls made to the logging module will be a no-op).
755795

756796
### Changes between Memfault SDK 0.2.5 and SDK 0.2.4 - March 20, 2020
@@ -799,7 +839,7 @@ void record_temperature(void) {
799839

800840
- Add support for compressing coredumps as they are sent using Run Length
801841
Encoding (RLE). More details can be found in
802-
[memfault/core/data_source_rle.h](components/core/include/memfault/core/data_source_rle.h).
842+
[memfault/core/data_source_rle.h](components/include/memfault/core/data_source_rle.h).
803843
- Update **metrics** component to support compilation with the IAR ARM C/C++
804844
Compiler.
805845
- Update Mbed OS 5 port to use `memfault_demo_shell` instead `mbed-client-cli`,
@@ -848,8 +888,7 @@ void record_temperature(void) {
848888
### Changes between Memfault SDK 0.0.16 and SDK 0.0.15 - Jan 6, 2020
849889

850890
- Add convenience API, `memfault_packetizer_get_chunk()`, to
851-
[data_packetizer](components/core/include/memfault/core/data_packetizer.h)
852-
module.
891+
[data_packetizer](components/include/memfault/core/data_packetizer.h) module.
853892
- Add a new eMfltCoredumpRegionType, `MemoryWordAccessOnly` which can be used to
854893
force the region to be read 32 bits at a time. This can be useful for
855894
accessing certain peripheral register ranges which are not byte addressable.

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ is needed for your project. The SDK has been designed to have minimal impact on
2424
code-space, bandwidth, and power consumption.
2525

2626
The [`components`](components/) directory folder contains the various components
27-
of the SDK. Each component contains a`README.md`, source code, header files and
27+
of the SDK. Each component contains a `README.md`, source code, header files and
2828
"platform" header files.
2929

3030
The platform header files describe the interfaces which the component relies on
@@ -65,23 +65,25 @@ typically looks like:
6565

6666
```
6767
<YOUR_PROJECT>
68-
├── memfault
69-
│ └── sdk
70-
│ # Contents of _this_ repo
71-
│ # (https://github.com/memfault/memfault-firmware-sdk)
72-
│ └── platform_port
73-
│ # Implementations for the Memfault SDK dependencies
74-
│ # specified in the platform include directory for each component in the SDK
75-
│ ├── memfault_platform_core.c
76-
│ ├── memfault_platform_coredump.c
77-
│ ├── [...]
68+
├── third_party/memfault
69+
│ ├── memfault-firmware-sdk (submodule)
70+
│ │
71+
│ │ # Files where port to your platform will be implemented
72+
│ ├── memfault_platform_port.c
73+
│ ├── memfault_platform_coredump_regions.c
74+
│ │
75+
│ │ # Configuration headers
76+
│ ├── memfault_platform_config.h
77+
│ ├── memfault_trace_reason_user_config.def
78+
│ ├── memfault_metrics_heartbeat_config.def
79+
│ └── memfault_platform_log_config.h
7880
```
7981

8082
If you are using `git`, the Memfault SDK is typically added to a project as a
8183
submodule:
8284

8385
```
84-
$ git submodule add [email protected]:memfault/memfault-firmware-sdk.git $YOUR_PROJECT/memfault/sdk
86+
$ git submodule add [email protected]:memfault/memfault-firmware-sdk.git $YOUR_PROJECT/third_party/memfault/memfault-firmware-sdk
8587
```
8688

8789
This makes it easy to track the history of the Memfault SDK. You should not need

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 178579
2-
GIT COMMIT: 60077f8d9
1+
BUILD ID: 190095
2+
GIT COMMIT: 2e8befdf1

components/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Memfault 💥
2+
3+
## Components
4+
5+
This directory contains the Memfault components that fall into two categories:
6+
7+
- Main components
8+
- Support components
9+
10+
A brief mention of each of the components is described here, however, see the
11+
`README.md` in the respective directories for a more complete description of
12+
each component. See also the online documentation at
13+
[Components](https://github.com/memfault/memfault-firmware-sdk#components).
14+
15+
### Main Components
16+
17+
The main components are `panics` and `metrics`. These components provide the
18+
high level features of the Memfault SDK to your product.
19+
20+
- panics - fault handling, coredump and reboot tracking and reboot loop
21+
detection API.
22+
- metrics - used to monitor device health over time (i.e. connectivity, battery
23+
life, MCU resource utilization, hardware degradation, etc.)
24+
25+
### Support Components
26+
27+
The support components include `core`, `http`, `util` and `demo` which, except
28+
for `demo`, are needed by the main components. The `demo` component is there to
29+
help demonstrate how to use the Memfault SDK.
30+
31+
- core - common code that is used by all other components.
32+
- demo - common code that is used by demo apps for the various platforms.
33+
- http - http client API, to post coredumps and events directly to the Memfault
34+
service from devices.
35+
- util - various utilities.

0 commit comments

Comments
 (0)