Skip to content

Commit

Permalink
Memfault Firmware SDK 0.39.0 (Build 1415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Memfault Inc committed Feb 6, 2023
1 parent 9caa5bf commit 5d66be4
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 18 deletions.
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
### Changes between Memfault SDK 0.39.0 and SDK 0.38.0 - Feb 3, 2023

#### :boom: Breaking Changes

- Breaking changes to the
[`memfault_freertos_get_task_regions()`](ports/freertos/src/memfault_freertos_ram_regions.c)
function, which can be used to capture FreeRTOS tasks when coredumps are sized
smaller than all available RAM. The function will now, by default, capture a
truncated copy of each FreeRTOS TCB, instead of the complete structure. This
makes better use of coredump storage space; the TCB structures can be very
large (>1kB), but Memfault only needs the first few fields for coredump
decoding. The configuration flag `MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE` (see
[`default_config.h`](components/include/memfault/default_config.h)) can be set
to `0` in `memfault_platform_config.h` to return to the previous behavior.

### Changes between Memfault SDK 0.38.0 and SDK 0.37.2 - Feb 1, 2023

#### :rocket: New Features
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BUILD ID: 1368
GIT COMMIT: 4a9233626
BUILD ID: 1415
GIT COMMIT: cb7a3096e
1 change: 1 addition & 0 deletions components/include/memfault/components.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extern "C" {
#include "memfault/panics/coredump.h"
#include "memfault/panics/fault_handling.h"
#include "memfault/panics/platform/coredump.h"
#include "memfault/util/banner.h"
#include "memfault/util/base64.h"
#include "memfault/util/cbor.h"
#include "memfault/util/circular_buffer.h"
Expand Down
24 changes: 16 additions & 8 deletions components/include/memfault/default_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,23 @@ extern "C" {
#define MEMFAULT_PLATFORM_COREDUMP_STORAGE_REGIONS_CUSTOM 0
#endif

//! Override the size of TCB memory to collect set by the FreeRTOS port. Default
//! behavior is to collect the entire TCB structure. This option is useful when using
//! FreeRTOS and coredump space is limited. In certain configurations, such as using
//! configUSE_NEWLIB_REENTRANT, FreeRTOS TCBs contain extra fields that are not required when
//! decoding coredumps. Using this option can free up coredump space for other memory regions if
//! needed. If `MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE` is set to 0, a default value for the TCB size
//! is used. Please see ports/freertos/src/memfault_freertos_ram_regions.c for more info
//! Set the capture size for FreeRTOS TCB structures in the coredump, when
//! memfault_freertos_ram_regions.c is used.
//!
//! Set this to 0 to collect the entire TCB structure.
//!
//! The default value captures the required structure fields in each TCB used
//! for RTOS Awareness by the Memfault backend, but truncates unused fields- for
//! example, if FreeRTOS is configured with configUSE_NEWLIB_REENTRANT, the TCBs
//! contain extra fields that are not needed for thread decode and take up space
//! in the coredump.
//!
//! See more details here: https://docs.memfault.com/docs/mcu/rtos-analysis
//!
//! And see ports/freertos/src/memfault_freertos_ram_regions.c for information
//! on the implementation
#ifndef MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE
#define MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE 0
#define MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE 100
#endif

#ifdef __cplusplus
Expand Down
30 changes: 30 additions & 0 deletions components/include/memfault/util/banner.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

//! @file
//!
//! Copyright (c) Memfault, Inc.
//! See License.txt for details
//!
//! Memfault splash screen banner.

#ifdef __cplusplus
extern "C" {
#endif

// clang-format off
#define MEMFAULT_BANNER_(MEMFAULT_COLOR_START, MEMFAULT_COLOR_END) \
"▙▗▌ ▗▀▖ ▜▐ " MEMFAULT_COLOR_START " ▄▄▀▀▄▄ " MEMFAULT_COLOR_END "\n" \
"▌▘▌▞▀▖▛▚▀▖▐ ▝▀▖▌ ▌▐▜▀ " MEMFAULT_COLOR_START " █▄ ▄█" MEMFAULT_COLOR_END "\n" \
"▌ ▌▛▀ ▌▐ ▌▜▀ ▞▀▌▌ ▌▐▐ ▖ " MEMFAULT_COLOR_START " ▄▀▀▄▄▀▀▄" MEMFAULT_COLOR_END "\n" \
"▘ ▘▝▀▘▘▝ ▘▐ ▝▀▘▝▀▘ ▘▀ " MEMFAULT_COLOR_START " ▀▀▄▄▀▀ " MEMFAULT_COLOR_END "\n"
// clang-format on

//! Memfault banner with colorized logo
#define MEMFAULT_BANNER_COLORIZED MEMFAULT_BANNER_("\e[36m", "\e[0m")

//! Memfault banner with monochrome logo
#define MEMFAULT_BANNER_MONOCHROME MEMFAULT_BANNER_("", "")

#ifdef __cplusplus
}
#endif
2 changes: 1 addition & 1 deletion components/include/memfault/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef struct {
uint8_t patch;
} sMfltSdkVersion;

#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 38, .patch = 0 }
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 39, .patch = 0 }

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,8 @@ void app_main() {
*/
const char *prompt = LOG_COLOR_I "esp32> " LOG_RESET_COLOR;

const char banner[] = "\n\n"
"▙▗▌ ▗▀▖ ▜▐ \e[36m ▄▄▀▀▄▄ \e[0m\n"
"▌▘▌▞▀▖▛▚▀▖▐ ▝▀▖▌ ▌▐▜▀ \e[36m █▄ ▄█\e[0m\n"
"▌ ▌▛▀ ▌▐ ▌▜▀ ▞▀▌▌ ▌▐▐ ▖ \e[36m ▄▀▀▄▄▀▀▄\e[0m\n"
"▘ ▘▝▀▘▘▝ ▘▐ ▝▀▘▝▀▘ ▘▀ \e[36m ▀▀▄▄▀▀ \e[0m\n";
const char banner[] = "\n\n" MEMFAULT_BANNER_COLORIZED;

puts(banner);

/* Figure out if the terminal supports escape sequences */
Expand Down
4 changes: 2 additions & 2 deletions ports/freertos/src/memfault_freertos_ram_regions.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
#error "'#include "memfault/ports/freertos_trace.h"' must be added to FreeRTOSConfig.h"
#endif

// If the MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE value is not already set, apply a default to
// MEMFAULT_FREERTOS_TCB_SIZE here. This value can be overriden by setting
// If the MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE value is set to 0, apply a default
// to MEMFAULT_FREERTOS_TCB_SIZE here. This value can be overriden by setting
// MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE in memfault_platform_config.h. See
// include/memfault/default_config.h for more information.
#if MEMFAULT_PLATFORM_FREERTOS_TCB_SIZE
Expand Down

0 comments on commit 5d66be4

Please sign in to comment.