Skip to content

Commit 0cf1078

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.33.2 (Build 512901)
1 parent c59f03f commit 0cf1078

File tree

10 files changed

+77
-11
lines changed

10 files changed

+77
-11
lines changed

.circleci/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# This Docker image is used in CircleCI to build the SDK. It's published to
2+
# Docker Hub as "memfault/memfault-sdk-embedded-ci".
3+
#
4+
# It's built with the following command (assuming cwd is the directory
5+
# containing this Dockerfile):
6+
#
7+
# ❯ DOCKER_BUILDKIT=1 docker build -t memfault/memfault-firmware-sdk-ci:<tag> .
8+
#
9+
# And uploaded to Docker Hub:
10+
# ❯ docker push memfault/memfault-firmware-sdk-ci:<tag>
11+
112
FROM ubuntu:22.04
213

314
# Some details based on this Dockerfile:

CHANGES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
### Changes between Memfault SDK 0.33.1 and SDK 0.33.2 - Sept 7, 2022
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- Zephyr port updates:
6+
- fix a few minor nuisance build warnings on niche Zephyr configurations
7+
- enable `LOG_OUTPUT` when `MEMFAULT_LOGGING_ENABLE` is enabled- this fixes a
8+
build error if all other log backends are disabled. thanks to @balaji-nordic
9+
for this fix! closes #33
10+
- Add a debug cli test command to the nRF-Connect SDK port for printing the OTA
11+
url
12+
113
### Changes between Memfault SDK 0.33.0 and SDK 0.33.1 - Aug 26, 2022
214

315
#### :chart_with_upwards_trend: Improvements
@@ -89,6 +101,9 @@
89101
"Breaking Changes" below for enabling logs in your project.
90102
- Added a new Kconfig option, `MEMFAULT_ZEPHYR_FATAL_HANDLER`, which can be
91103
used to disable the Zephyr fault handler print facilities.
104+
- Streamline support for nRF-Connect SDK based applications that don't need
105+
the Memfault root certificates (eg nRF53 or nRF52 devices), via a new
106+
Kconfig option `MEMFAULT_ROOT_CERT_STORAGE`, to avoid a nuisance build error
92107

93108
#### :boom: Breaking Changes
94109

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 503780
2-
GIT COMMIT: ef36b85f7
1+
BUILD ID: 512901
2+
GIT COMMIT: a0c2c2f58

components/demo/src/memfault_demo_cli_log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
int memfault_demo_cli_cmd_test_log(MEMFAULT_UNUSED int argc,
1818
MEMFAULT_UNUSED char *argv[]) {
19+
MEMFAULT_LOG_RAW("Raw log!");
1920
MEMFAULT_LOG_DEBUG("Debug log!");
2021
MEMFAULT_LOG_INFO("Info log!");
2122
MEMFAULT_LOG_WARN("Warning log!");

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 = 1 }
22+
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 33, .patch = 2 }
2323

2424
#ifdef __cplusplus
2525
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313

1414
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
1515

16+
//! wrapper to enclose logic around log_strdup
17+
char *prv_conditional_log_strdup(char *str) {
18+
#if !MEMFAULT_ZEPHYR_VERSION_GT(3, 1)
19+
#if defined(CONFIG_LOG) && !defined(CONFIG_LOG2)
20+
// Before zephyr 3.1, LOG was a different option from LOG2 and required
21+
// manually duplicating string argument values. Only required if CONFIG_LOG is
22+
// in use.
23+
return log_strdup(str);
24+
#endif
25+
#endif
26+
27+
return str;
28+
}
1629
static void prv_set_device_id(void) {
1730
uint8_t dev_id[16] = {0};
1831
char dev_id_str[sizeof(dev_id) * 2 + 1];
@@ -33,12 +46,14 @@ static void prv_set_device_id(void) {
3346
dev_str = dev_id_str;
3447
}
3548

36-
LOG_INF("Device ID: %s", dev_str);
49+
LOG_INF("Device ID: %s", prv_conditional_log_strdup(dev_str));
3750

3851
memfault_ncs_device_id_set(dev_str, length * 2);
3952
}
4053

4154
void main(void) {
55+
LOG_INF("Booting Memfault sample app!");
56+
4257
// Set the device id based on the hardware UID
4358
prv_set_device_id();
4459

ports/zephyr/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config MEMFAULT
55
select RUNTIME_NMI
66
select EXTRA_EXCEPTION_INFO
77
select DEBUG_THREAD_INFO
8+
select LEGACY_INCLUDE_PATH
89
help
910
Enable Zephyr Integration with the Memfault SDK
1011
At the moment a port is only provided for Cortex-M based targets
@@ -113,6 +114,7 @@ config MEMFAULT_LOGGING_ENABLE
113114
bool "MEMFAULT Zephyr backend logging Enable [EXPERIMENTAL]"
114115
default n
115116
select LOG
117+
select LOG_OUTPUT
116118
help
117119
Adds support for routing Zephyr logging calls to the Memfault
118120
logging backend.

ports/zephyr/common/memfault_logging_legacy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ static void prv_log_put(const struct log_backend *const backend, struct log_msg
109109
static void prv_log_put_sync_string(const struct log_backend *const backend,
110110
struct log_msg_ids src_level, uint32_t timestamp,
111111
const char *fmt, va_list ap) {
112-
printk("HERE WE GOOO\n");
113112
if (memfault_arch_is_inside_isr()) {
114113
// In synchronous mode, logging can occur from ISRs. The zephyr fault handlers are chatty so
115114
// don't save info while in an ISR to avoid wrapping over the info we are collecting.

ports/zephyr/common/memfault_platform_debug_log.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ void memfault_platform_log_raw(const char *fmt, ...) {
9191
((KERNEL_VERSION_MAJOR > (major)) || \
9292
((KERNEL_VERSION_MAJOR == (major)) && (KERNEL_VERSION_MINOR >= (minor))))
9393

94-
#if ZEPHYR_VERSION_GTE(3, 0)
9594
char log_buf[MEMFAULT_DEBUG_LOG_BUFFER_SIZE_BYTES];
9695
vsnprintf(log_buf, sizeof(log_buf), fmt, args);
97-
LOG_PRINTK("%s", log_buf);
96+
#if ZEPHYR_VERSION_GTE(3, 0)
97+
LOG_PRINTK("%s\n", log_buf);
9898
#else
99-
log_printk("%s\n", args);
99+
printk("%s\n", log_buf);
100100
#endif
101101

102102
va_end(args);

ports/zephyr/ncs/src/memfault_nrf_cli.c

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <shell/shell.h>
77

88
#include "memfault/core/debug_log.h"
9-
109
#include "memfault/nrfconnect_port/fota.h"
10+
#include "memfault/ports/zephyr/http.h"
1111

1212
static int prv_mflt_fota(const struct shell *shell, size_t argc, char **argv) {
1313
#if CONFIG_MEMFAULT_FOTA_CLI_CMD
@@ -23,10 +23,33 @@ static int prv_mflt_fota(const struct shell *shell, size_t argc, char **argv) {
2323
#endif
2424
}
2525

26+
#if CONFIG_MEMFAULT_HTTP_ENABLE
27+
static int prv_mflt_get_latest_url(const struct shell *shell, size_t argc, char **argv) {
28+
char *url = NULL;
29+
int rv = memfault_zephyr_port_get_download_url(&url);
30+
if (rv <= 0) {
31+
MEMFAULT_LOG_ERROR("Unable to fetch OTA url, rv=%d", rv);
32+
return rv;
33+
}
34+
35+
printk("Download URL: '%s'\n", url);
36+
37+
rv = memfault_zephyr_port_release_download_url(&url);
38+
39+
return rv;
40+
}
41+
#endif // CONFIG_MEMFAULT_HTTP_ENABLE
42+
2643
SHELL_STATIC_SUBCMD_SET_CREATE(
2744
sub_memfault_nrf_cmds,
28-
SHELL_CMD(fota, NULL, "Perform a FOTA using Memfault client", prv_mflt_fota),
45+
SHELL_CMD(fota, NULL, "Perform a FOTA using Memfault client",
46+
prv_mflt_fota),
47+
#if CONFIG_MEMFAULT_HTTP_ENABLE
48+
SHELL_CMD(get_latest_url, NULL, "Get the latest URL for the latest FOTA",
49+
prv_mflt_get_latest_url),
50+
#endif
2951
SHELL_SUBCMD_SET_END /* Array terminated. */
3052
);
3153

32-
SHELL_CMD_REGISTER(mflt_nrf, &sub_memfault_nrf_cmds, "Memfault nRF Connect SDK Test Commands", NULL);
54+
SHELL_CMD_REGISTER(mflt_nrf, &sub_memfault_nrf_cmds,
55+
"Memfault nRF Connect SDK Test Commands", NULL);

0 commit comments

Comments
 (0)