Skip to content

Commit

Permalink
Memfault Firmware SDK 1.11.5 (Build 10200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Memfault Inc committed Sep 18, 2024
1 parent 0fbb820 commit 00ff70f
Show file tree
Hide file tree
Showing 491 changed files with 1,665 additions and 1,072 deletions.
696 changes: 396 additions & 300 deletions CHANGELOG.md

Large diffs are not rendered by default.

File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ the top for build & test coverage status of the `master` branch.
## License
Unless specifically indicated otherwise in a file, all memfault-firmware-sdk
files are all licensed under the [Memfault License](/License.txt). (A few files
in the [examples](/examples) and [ports](/ports) directory are licensed
differently based on vendor requirements.)
files are all licensed under the [Memfault License](/LICENSE). (A few files in
the [examples](/examples) and [ports](/ports) directory are licensed differently
based on vendor requirements.)
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BUILD ID: local
GIT COMMIT: a3e5d59615c
VERSION: 1.11.4
BUILD ID: 10200
GIT COMMIT: 432492ab6b
VERSION: 1.11.5
2 changes: 1 addition & 1 deletion components/core/src/arch_arm_cortex_m.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details

#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_batched_events.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!

#include <string.h>
Expand Down
41 changes: 40 additions & 1 deletion components/core/src/memfault_build_id.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! See header for more details
Expand All @@ -13,6 +13,37 @@
#include "memfault/core/build_info.h"
#include "memfault_build_id_private.h"

// OS version information
#if defined(MEMFAULT_OS_VERSION_NAME) ^ defined(MEMFAULT_OS_VERSION_STRING)
#error "MEMFAULT_OS_VERSION_NAME and MEMFAULT_OS_VERSION_STRING must be both defined or undefined"
#elif !(defined(MEMFAULT_OS_VERSION_NAME) && defined(MEMFAULT_OS_VERSION_STRING))
#if defined(__ZEPHYR__)
// Either Zephyr or NCS. We can then rely on the GNU __has_include extension to
// be available.
#if __has_include("ncs_version.h")
#include "ncs_version.h"
#define MEMFAULT_OS_VERSION_NAME "ncs"
#define MEMFAULT_OS_VERSION_STRING NCS_VERSION_STRING
#else
// This is Zephyr's version.h file, since Memfault's is namespaced as
// "memfault/version.h".
#include <version.h>
#define MEMFAULT_OS_VERSION_NAME "zephyr"
#define MEMFAULT_OS_VERSION_STRING KERNEL_VERSION_STRING
#endif /* __has_include("ncs_version.h") */

#elif defined(ESP_PLATFORM)
// ESP-IDF, use the command-line defined IDF_VER string
#define MEMFAULT_OS_VERSION_NAME "esp-idf"
#define MEMFAULT_OS_VERSION_STRING IDF_VER
#else
// No OS version information available
#define MEMFAULT_OS_VERSION_NAME ""
#define MEMFAULT_OS_VERSION_STRING ""
#endif /* defined(__ZEPHYR__) */
#endif /* defined(MEMFAULT_OS_VERSION_NAME) ^ defined(MEMFAULT_OS_VERSION_STRING) \
*/

#if MEMFAULT_USE_GNU_BUILD_ID

// Note: This variable is emitted by the linker script
Expand All @@ -24,6 +55,10 @@ MEMFAULT_BUILD_ID_QUALIFIER sMemfaultBuildIdStorage g_memfault_build_id = {
.short_len = MEMFAULT_EVENT_INCLUDED_BUILD_ID_SIZE_BYTES,
.storage = MEMFAULT_GNU_BUILD_ID_SYMBOL,
.sdk_version = MEMFAULT_SDK_VERSION,
.os_version = {
.name = MEMFAULT_OS_VERSION_NAME,
.version = MEMFAULT_OS_VERSION_STRING,
},
};
#else

Expand All @@ -38,5 +73,9 @@ MEMFAULT_BUILD_ID_QUALIFIER sMemfaultBuildIdStorage g_memfault_build_id = {
.short_len = MEMFAULT_EVENT_INCLUDED_BUILD_ID_SIZE_BYTES,
.storage = g_memfault_sdk_derived_build_id,
.sdk_version = MEMFAULT_SDK_VERSION,
.os_version = {
.name = MEMFAULT_OS_VERSION_NAME,
.version = MEMFAULT_OS_VERSION_STRING,
},
};
#endif
8 changes: 7 additions & 1 deletion components/core/src/memfault_build_id_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Internal file that should never be included by a consumer of the SDK. See
Expand Down Expand Up @@ -33,6 +33,11 @@ typedef enum {
kMemfaultBuildIdType_MemfaultBuildIdSha1 = 3,
} eMemfaultBuildIdType;

typedef struct {
const char *name;
const char *version;
} sMfltOsVersion;

typedef struct {
uint8_t type; // eMemfaultBuildIdType
uint8_t len;
Expand All @@ -41,6 +46,7 @@ typedef struct {
uint8_t rsvd;
const void *storage;
const sMfltSdkVersion sdk_version;
const sMfltOsVersion os_version;
} sMemfaultBuildIdStorage;

MEMFAULT_STATIC_ASSERT(((offsetof(sMemfaultBuildIdStorage, type) == 0) &&
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_compact_log_serializer.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details

#include <stdarg.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_core_utils.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_custom_data_recording.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! Implements sMemfaultDataSourceImpl API specified in data_packetizer_source.h to serialize a
//! custom data recording such that it can be published to the Memfault cloud.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! APIs intended for internal use _only_. And end user should never invoke these

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_data_export.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_data_packetizer.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details

#include <inttypes.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_data_source_rle.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! See header for more details
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_event_storage.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! A RAM-backed storage API for serialized events. This is where events (such as heartbeats and
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_heap_stats.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! Simple heap allocation tracking utility. Intended to shim into a system's
//! malloc/free implementation to track last allocations with callsite
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_log.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! A simple RAM backed logging storage implementation. When a device crashes and the memory region
//! is collected using the panics component, the logs will be decoded and displayed in the Memfault
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_log_data_source.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!

#include "memfault/config.h"
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_log_data_source_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Internal logging data source
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_log_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Utilities to assist with querying the log buffer
Expand Down
27 changes: 1 addition & 26 deletions components/core/src/memfault_ram_reboot_info_tracking.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! A RAM-backed implementation used for tracking state across system reboots. More details about
Expand Down Expand Up @@ -38,31 +38,6 @@
// clang-format on
#define MEMFAULT_REBOOT_REASON_NOT_SET 0xffffffff

typedef MEMFAULT_PACKED_STRUCT MfltRebootInfo {
//! A cheap way to check if the data within the struct is valid
uint32_t magic;
//! Version of the struct. If a new field is added it should be appended right before rsvd. This
//! way we can remain backwards compatible but know what fields are valid.
uint8_t version;
//! The number of times the system has reset due to an error
//! without any crash data being read out via the Memfault packetizer
uint8_t crash_count;
uint8_t rsvd1[1];
uint8_t coredump_saved;
uint32_t last_reboot_reason; // eMemfaultRebootReason or MEMFAULT_REBOOT_REASON_NOT_SET
uint32_t pc;
uint32_t lr;
//! Most MCUs have a register which reveals why a device rebooted.
//!
//! This can be particularly useful for debugging reasons for unexpected reboots
//! (where no coredump was saved or no user initiated reset took place). Examples
//! of this include brown out resets (BORs) & hardware watchdog resets.
uint32_t reset_reason_reg0;
// Reserved for future additions
uint32_t rsvd2[10];
}
sMfltRebootInfo;

MEMFAULT_STATIC_ASSERT(sizeof(sMfltRebootInfo) == MEMFAULT_REBOOT_TRACKING_REGION_SIZE,
"struct doesn't match expected size");

Expand Down
27 changes: 26 additions & 1 deletion components/core/src/memfault_reboot_tracking_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Internal utilities used for tracking reboot reasons
Expand All @@ -17,6 +17,31 @@
extern "C" {
#endif

typedef MEMFAULT_PACKED_STRUCT MfltRebootInfo {
//! A cheap way to check if the data within the struct is valid
uint32_t magic;
//! Version of the struct. If a new field is added it should be appended right before rsvd. This
//! way we can remain backwards compatible but know what fields are valid.
uint8_t version;
//! The number of times the system has reset due to an error
//! without any crash data being read out via the Memfault packetizer
uint8_t crash_count;
uint8_t rsvd1[1];
uint8_t coredump_saved;
uint32_t last_reboot_reason; // eMemfaultRebootReason or MEMFAULT_REBOOT_REASON_NOT_SET
uint32_t pc;
uint32_t lr;
//! Most MCUs have a register which reveals why a device rebooted.
//!
//! This can be particularly useful for debugging reasons for unexpected reboots
//! (where no coredump was saved or no user initiated reset took place). Examples
//! of this include brown out resets (BORs) & hardware watchdog resets.
uint32_t reset_reason_reg0;
// Reserved for future additions
uint32_t rsvd2[10];
}
sMfltRebootInfo;

typedef struct MfltResetReasonInfo {
eMemfaultRebootReason reason;
uint32_t pc;
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_reboot_tracking_serializer.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Reads the current reboot tracking information and converts it into an "trace" event which can
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_sdk_assert.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details

#include <inttypes.h>

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_self_test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! Memfault SDK self test functions to verify SDK integration
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_self_test_private.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
#pragma once

#include <stdbool.h>
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_self_test_utils.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_serializer_helper.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! @brief
//! See header for more details
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/memfault_task_watchdog.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//! See LICENSE for details
//!
//! Task watchdog implementation.

Expand Down
Loading

0 comments on commit 00ff70f

Please sign in to comment.