Skip to content

Commit dfffeb4

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.2.0 (Build 3361)
1 parent bf7e954 commit dfffeb4

Some content is hidden

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

51 files changed

+671
-128
lines changed

CHANGES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### Changes between Memfault SDK 1.1.3 and 1.2.0 - Aug 30, 2023
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- ESP-IDF:
6+
- Eliminate several build warnings for our example app
7+
- FreeRTOS:
8+
- Fix a build error in our QEMU example when building on macOS
9+
- nRF Connect SDK:
10+
- Enable mcuboot & NCS 1.4 with our example apps
11+
- Silicon Labs:
12+
- Add a demo CLI component for the emblib port. Check out our [Simplicity Studio example app](https://github.com/memfault/simplicity-studio-example) for usage
13+
- Fix a build warning in emblib port flash storage (MSC) module
14+
- Zephyr:
15+
- Fix a :bug: when building with LOG_MODE_DEFERRED that prevent log messages from flushing during a coredump
16+
- Fix a :bug: and warnings involving older Zephyr header paths. Resolves [#62](https://github.com/memfault/memfault-firmware-sdk/issues/62) and [#57](https://github.com/memfault/memfault-firmware-sdk/issues/57). Thanks @JordanYates and @YHusain1 for reporting these issues.
17+
118
### Changes between Memfault SDK 1.1.2 and 1.1.3 - Aug 8, 2023
219

320
#### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 3171
2-
GIT COMMIT: cd928ad15
1+
BUILD ID: 3361
2+
GIT COMMIT: d427c1e05

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 = 1, .patch = 3 }
23-
#define MEMFAULT_SDK_VERSION_STR "1.1.3"
22+
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 2, .patch = 0 }
23+
#define MEMFAULT_SDK_VERSION_STR "1.2.0"
2424

2525
#ifdef __cplusplus
2626
}

examples/esp32/apps/memfault_demo_app/main/console_example_main.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ static const char *TAG = "example";
4747
static void initialize_filesystem() {
4848
static wl_handle_t wl_handle;
4949
const esp_vfs_fat_mount_config_t mount_config = {.max_files = 4, .format_if_mount_failed = true};
50-
esp_err_t err = esp_vfs_fat_spiflash_mount(MOUNT_PATH, "storage", &mount_config, &wl_handle);
50+
esp_err_t err =
51+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
52+
esp_vfs_fat_spiflash_mount_rw_wl
53+
#else
54+
esp_vfs_fat_spiflash_mount
55+
#endif
56+
(MOUNT_PATH, "storage", &mount_config, &wl_handle);
5157
if (err != ESP_OK) {
5258
ESP_LOGE(TAG, "Failed to mount FATFS (%s)", esp_err_to_name(err));
5359
return;
@@ -74,10 +80,17 @@ static void initialize_console() {
7480
setvbuf(stdin, NULL, _IONBF, 0);
7581
setvbuf(stdout, NULL, _IONBF, 0);
7682

83+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
84+
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
85+
esp_vfs_dev_uart_port_set_rx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CR);
86+
/* Move the caret to the beginning of the next line on '\n' */
87+
esp_vfs_dev_uart_port_set_tx_line_endings(CONFIG_ESP_CONSOLE_UART_NUM, ESP_LINE_ENDINGS_CRLF);
88+
#else
7789
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
7890
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
7991
/* Move the caret to the beginning of the next line on '\n' */
8092
esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
93+
#endif
8194

8295
/* Install UART driver for interrupt-driven reads and writes */
8396
ESP_ERROR_CHECK(uart_driver_install(CONFIG_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0));

examples/freertos/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ MAKEFLAGS=--warn-undefined-variables
44
# Default to a silent build. Run make with --trace for a verbose build.
55
.SILENT:
66

7+
8+
# Mac and Linux stat have different options required, set them up here
9+
ifeq ($(shell uname), Darwin)
10+
STAT = "stat -f '%z'"
11+
else
12+
STAT = "stat -c '%s'"
13+
endif
14+
715
BOARD ?= qemu_mps2_an385
816
BOARD_DIR := boards/$(BOARD)
917

@@ -128,7 +136,7 @@ $(ELF).uncompressed: $(OBJS)
128136
$(ELF): $(ELF).uncompressed
129137
echo -n 'Compressing debug info... '
130138
$(OBJCOPY) --compress-debug-sections $^ $@
131-
echo From $$(stat --printf="%s" $^) to $$(stat --printf="%s" $@) bytes
139+
echo From $$("$(STAT)" $^) to $$("$(STAT)" $@) bytes
132140

133141
-include $(OBJS:.o=.d)
134142

examples/nrf-connect-sdk/nrf5/memfault_demo_app/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ CONFIG_SHELL_LOG_BACKEND=n
3636
CONFIG_LOG_MODE_IMMEDIATE=y
3737
# Enable DBG log level
3838
CONFIG_MEMFAULT_LOG_LEVEL_DBG=y
39+
# Disable logging of printk, to improve 'mflt export' performance under deferred
40+
# logging mode.
41+
CONFIG_LOG_PRINTK=n
3942

4043
# Enable capture of recent logs as part of a coredump
4144
CONFIG_MEMFAULT_LOGGING_ENABLE=y

examples/nrf-connect-sdk/nrf5/memfault_demo_app/src/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
//!
66
//! Example console main
77

8-
#include <drivers/hwinfo.h>
9-
#include <logging/log.h>
8+
// clang-format off
9+
#include "memfault/ports/zephyr/include_compatibility.h"
10+
11+
#include MEMFAULT_ZEPHYR_INCLUDE(drivers/hwinfo.h)
12+
#include MEMFAULT_ZEPHYR_INCLUDE(logging/log.h)
1013
#include <memfault/components.h>
1114
#include <memfault_ncs.h>
1215
#include <stdio.h>
1316

1417
#include "memfault/ports/watchdog.h"
18+
// clang-format on
1519

1620
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
1721

examples/nrf-connect-sdk/nrf9160/memfault_demo_app/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ else() # nRF Connect SDK Version >= 1.8.0
102102
endif()
103103
endif()
104104

105+
if (${NCS_VERSION_MAJOR}.${NCS_VERSION_MINOR}.${NCS_VERSION_PATCH} GREATER_EQUAL 2.4.0)
106+
# In Zephyr v3.4 release, FLASH_MAP and STREAM_FLASH must be specified manually
107+
# https://github.com/zephyrproject-rtos/zephyr/commit/c3bfe7a6baf7e47d8ad70e38ffdea313f3ec62ce
108+
#
109+
# These are required for NCS >= 2.4
110+
set(CONFIG_FLASH_MAP y CACHE INTERNAL "")
111+
set(CONFIG_STREAM_FLASH y CACHE INTERNAL "")
112+
endif()
113+
105114
# Required for app to compile against nRF Connect SDK <= v1.2
106115
# Must be included after updating Kconfig settings in CMake Cache above
107116
if(DEFINED ENV{MEMFAULT_INCLUDE_ZEPHYR_BOILERPLATE})

examples/nrf-connect-sdk/nrf9160/memfault_demo_app/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ https://goto.memfault.com/create-key/nrf91
1212
## Compiling
1313

1414
You can compile for any board supported by the nRF Connect SDK. For example,
15-
targetting the nRF52 PDK would look like:
15+
targeting the nRF91 PDK would look like:
1616

1717
```bash
1818
$ west init -l memfault_demo_app
1919
$ west update
2020
# Replace ${YOUR_PROJECT_KEY} with the Project Key from https://mflt.io/project-key
21-
$ west build -b nrf9160dk_nrf9160ns memfault_demo_app -- -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${YOUR_PROJECT_KEY}\"
21+
$ west build -b nrf9160dk_nrf9160_ns memfault_demo_app -- -DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${YOUR_PROJECT_KEY}\"
2222
...
2323
[181/181] Linking C executable zephyr/zephyr.elf
2424
```
2525

26-
Note that the board argument (`-b`) for the nRF9160DK has changed across releases -- if you are targetting nRF Connect SDK <= 1.6, use, `-b nrf9160_pca10090ns`
26+
Note that the board argument (`-b`) for the nRF9160DK has changed across releases -- if you are targeting nRF Connect SDK <= 1.6, use, `-b nrf9160_pca10090ns`. Also, you may want to target a version of the DK by passing `-b <board>@<revision>`, for example `[email protected]`, in order to use [specific hardware](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/boards/arm/nrf9160dk_nrf9160/doc/index.html#additional-hardware-in-v0-14-0).
2727

2828
## Testing the Integration
2929

examples/nrf-connect-sdk/nrf9160/memfault_demo_app/prj.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ CONFIG_LOG_BACKEND_UART=y
3131
# Enable capture of recent logs as part of a coredump
3232
CONFIG_MEMFAULT_LOGGING_ENABLE=y
3333

34+
# Disable logging of printk, to improve 'mflt export' performance under deferred
35+
# logging mode.
36+
CONFIG_LOG_PRINTK=n
37+
3438
# Enable Bootloader so OTA updates can be performed
3539
CONFIG_BOOTLOADER_MCUBOOT=y
3640
CONFIG_MCUBOOT_IMG_MANAGER=y
@@ -42,6 +46,8 @@ CONFIG_DFU_TARGET_MCUBOOT=y
4246
CONFIG_IMG_MANAGER=y
4347
CONFIG_FLASH=y
4448
CONFIG_IMG_ERASE_PROGRESSIVELY=y
49+
# NB: CONFIG_FLASH_MAP=y & CONFIG_STREAM_FLASH=y are required for v2.4 and set dynamically in
50+
# ./CMakeLists.txt
4551

4652
# For Memfault FOTA, we will use the FOTA_DOWNLOAD API's
4753
# from the nRF Connect SDK which depends on the DOWNLOAD_CLIENT

0 commit comments

Comments
 (0)