Skip to content

Commit 34fe806

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.33.5 (Build 161)
1 parent 5a265a6 commit 34fe806

Some content is hidden

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

47 files changed

+512
-48
lines changed

CHANGES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
### Changes between Memfault SDK 0.33.4 and SDK 0.33.5 - Oct 19, 2022
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- nRF-Connect: Update the nRF9160 example application,
6+
`examples/nrf-connect-sdk/nrf9160`, to build and run correctly with
7+
nRF-Connect SDK v2.1.0
8+
- Zephyr: Add an example Zephyr application targeting the QEMU board
9+
- ESP-IDF:
10+
- Add a configuration option for setting the ESP-IDF HTTP client timeout value
11+
- Fix compilation for the ESP32-S3. _Note: coredumps are currently only
12+
supported on the ESP32, not the ESP32-S2, -S3, or -C3. This change only
13+
fixes compiling for the -S3 platform_
14+
- Add support for ESP-IDF v4.2.3
15+
16+
#### :house: Internal
17+
18+
- Support building the unit tests with GCC 12
19+
- Miscellaneous fixes to unit test infrastructure to better support building in
20+
Mac OSX
21+
122
### Changes between Memfault SDK 0.33.3 and SDK 0.33.4 - Sept 15, 2022
223

324
#### :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: 518181
2-
GIT COMMIT: 091f1bf24
1+
BUILD ID: 161
2+
GIT COMMIT: d4c377659

components/include/memfault/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef struct {
1919
uint8_t patch;
2020
} sMfltSdkVersion;
2121

22-
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 33, .patch = 4 }
22+
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 33, .patch = 5 }
2323

2424
#ifdef __cplusplus
2525
}

examples/esp32/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Memfault SDK has been tested to be compatible with these versions of
1010
ESP-IDF:
1111

1212
- v3.x release series
13-
- v4.x release series through v4.4.1
13+
- v4.x release series through v4.4.2
1414

1515
Other versions may be also be compatible but have not been verified by Memfault.
1616

@@ -59,7 +59,7 @@ We assume you have a working setup for the
5959
```bash
6060
cd examples/esp32/
6161
rm -rf esp-idf
62-
git clone -b v4.2.2 --recursive https://github.com/espressif/esp-idf.git esp-idf
62+
git clone -b v4.2.4 --recursive https://github.com/espressif/esp-idf.git esp-idf
6363
cd esp-idf
6464
export IDF_TOOLS_PATH=$(pwd)
6565
# you may need to install the sdk tools by running ./install.sh here

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ else() # nRF Connect SDK Version >= 1.8.0
9494

9595
# Use SPM instead of TFM for Secure Firmware as TFM does not (yet) support forwarding of fault handlers
9696
set(CONFIG_BUILD_WITH_TFM n CACHE INTERNAL "")
97+
# Explicitly set SPM=y because as of nRF Connect >= 2.1.0 it is marked as deprecated and no longer enabled by default
98+
set(CONFIG_SPM y CACHE INTERNAL "")
9799
endif()
98100

99101
# Required for app to compile against nRF Connect SDK <= v1.2

examples/nrf-connect-sdk/nrf9160/memfault_demo_app/src/watchdog.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include <version.h>
1414
#include <zephyr.h>
1515

16-
#include "memfault/core/debug_log.h"
16+
#include "memfault/components.h"
17+
18+
#include "memfault/ports/zephyr/version.h"
1719

1820
//! Note: The timeout must be large enough to give us enough time to capture a coredump
1921
//! before the system resets
@@ -25,10 +27,18 @@
2527
K_THREAD_STACK_DEFINE(s_wdt_task_stack_area, WATCHDOG_TASK_STACK_SIZE);
2628
struct k_thread my_thread_data;
2729

28-
#if KERNEL_VERSION_MAJOR == 2 && KERNEL_VERSION_MINOR < 2
29-
static struct device *s_wdt = NULL;
30-
#else
30+
#if MEMFAULT_ZEPHYR_VERSION_GT(3,1)
31+
// Between Zephyr 3.1 and 3.2, "label" properties in DTS started to get phased out:
32+
// https://github.com/zephyrproject-rtos/zephyr/pull/48360
33+
//
34+
// This breaks support for accessing device tree information via device_get_binding / DT_LABEL
35+
// properties. The new preferred approach is accessing resources via the DEVICE_DT_GET macro
36+
static const struct device *s_wdt = DEVICE_DT_GET(DT_NODELABEL(wdt));
37+
38+
#elif MEMFAULT_ZEPHYR_VERSION_GT(2,1)
3139
static const struct device *s_wdt = NULL;
40+
#else // Zephyr Kernel <= 2.1
41+
static struct device *s_wdt = NULL;
3242
#endif
3343

3444
#if KERNEL_VERSION_MAJOR == 2 && KERNEL_VERSION_MINOR < 3
@@ -75,11 +85,18 @@ static void prv_wdt_task(void *arg1, void *arg2, void *arg3) {
7585
void memfault_demo_app_watchdog_boot(void) {
7686
MEMFAULT_LOG_DEBUG("Initializing WDT Subsystem");
7787

88+
#if MEMFAULT_ZEPHYR_VERSION_GT(3,1)
89+
if (!device_is_ready(s_wdt)) {
90+
printk("Watchdog device not ready");
91+
return;
92+
}
93+
#else // Zephyr <= 3.1
7894
s_wdt = device_get_binding(WDT_DEV_NAME);
7995
if (s_wdt == NULL) {
8096
printk("No WDT device available\n");
8197
return;
8298
}
99+
#endif
83100

84101
struct wdt_timeout_cfg wdt_config = {
85102
/* Reset SoC when watchdog timer expires. */

examples/zephyr/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/zephyr/qemu/.gitignore

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

examples/zephyr/qemu/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Example Memfault Zephyr QEMU application
2+
3+
Based on https://github.com/zephyrproject-rtos/example-application , this
4+
provides a minimal reference for Memfault integration.
5+
6+
## Usage
7+
8+
After setting up a zephyr development environment
9+
(https://docs.zephyrproject.org/latest/getting_started/index.html), you can run
10+
the following commands to test the application:
11+
12+
```shell
13+
# initialize this project
14+
❯ west init -l qemu-app
15+
❯ west update
16+
17+
# build the target program
18+
# highly recommend '-DCONFIG_QEMU_ICOUNT=n' otherwise the guest runs too fast
19+
❯ west build -b qemu_cortex_m3 --pristine=always zephyr-memfault-example/app -- -DCONFIG_QEMU_ICOUNT=n
20+
❯ west build -t run
21+
22+
*** Booting Zephyr OS build zephyr-v3.1.0 ***
23+
[00:00:00.000,000] <inf> mflt: GNU Build ID: a3f2f5da83bc62ceb0351f88a8b30d5cdab59ae9
24+
[00:00:00.000,000] <inf> main: Memfault Demo App! Board qemu_cortex_m3
25+
26+
[00:00:00.000,000] <inf> mflt: S/N: DEMOSERIAL
27+
[00:00:00.000,000] <inf> mflt: SW type: zephyr-app
28+
[00:00:00.000,000] <inf> mflt: SW version: 1.0.0-dev
29+
[00:00:00.000,000] <inf> mflt: HW version: qemu_cortex_m3
30+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This CMake file is picked by the Zephyr build system because it is defined as
2+
# the module CMake entry point (see zephyr/module.yml).
3+
4+
# The Zephyr includes moved from /include to /include/zephyr in Zephyr 3.2:
5+
# https://github.com/zephyrproject-rtos/zephyr/commit/53ef68d4598b2f9005c5da3fc0b860ca1999d350
6+
# Add the old path for backwards compatibility. Note that Zephyr itself supports
7+
# the Kconfig option 'CONFIG_LEGACY_INCLUDE_PATH' to enable the same
8+
# compatibility behavior, but it's marked as deprecated and to be removed in the
9+
# future, so just apply the compatibiltiy fix here.
10+
if(${KERNEL_VERSION_MAJOR}.${KERNEL_VERSION_MINOR}.${KERNEL_PATCHLEVEL}
11+
VERSION_GREATER_EQUAL
12+
"3.1.99"
13+
)
14+
zephyr_include_directories(${ZEPHYR_BASE}/include/zephyr)
15+
# Set this to suppress a nuisance error warning about deprecated include paths
16+
zephyr_compile_options(-DCONFIG_LEGACY_INCLUDE_PATH=y)
17+
endif()
18+
19+
20+
EXECUTE_PROCESS(
21+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
22+
COMMAND git rev-parse --short HEAD
23+
RESULT_VARIABLE commit_sha1
24+
OUTPUT_VARIABLE ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1
25+
OUTPUT_STRIP_TRAILING_WHITESPACE
26+
COMMAND_ERROR_IS_FATAL ANY
27+
)
28+
29+
zephyr_compile_definitions(
30+
ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1=\"${ZEPHYR_MEMFAULT_EXAMPLE_GIT_SHA1}\"
31+
)

0 commit comments

Comments
 (0)