Skip to content

Commit cdb5fdb

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 0.31.0 (Build 451641)
1 parent bdacc2d commit cdb5fdb

22 files changed

+741
-59
lines changed

.cyignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmake
2+
examples
3+
makefile
4+
ports/atmel
5+
ports/dialog
6+
ports/emlib
7+
ports/esp8266_sdk
8+
ports/esp_idf
9+
ports/mynewt
10+
ports/nrf5_sdk
11+
ports/nxp
12+
ports/particle
13+
ports/qp
14+
ports/s32sdk
15+
ports/stm32cube
16+
ports/templates
17+
ports/zephyr
18+
scripts
19+
tests
20+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/core
21+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/demo
22+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/http
23+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/metrics
24+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/panics
25+
$(SEARCH_memfault-firmware-sdk)/components/include/memfault/util
26+
$(SEARCH_memfault-firmware-sdk)/ports/include/memfault/ports/ble
27+
$(SEARCH_memfault-firmware-sdk)/ports/include/memfault/ports/stm32cube

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
### Changes between Memfault SDK 0.31.0 and SDK 0.30.5 - June 6, 2022
2+
3+
#### :chart_with_upwards_trend: Improvements
4+
5+
- Added reference port for [CAT1A (PSoC:tm: 6)](https://github.com/Infineon/mtb-pdl-cat1) based
6+
MCUs using the
7+
[ModusToolbox:tm: Software](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software/)
8+
stack. For more details see [ports/cypress/psoc6](ports/cypress/psoc6) directory.
9+
- - Added a convenience utility function for posting chunks using the Memfault http client. See
10+
[`memfault_http_client_post_chunk`](components/include/memfault/http/http_client.h#L101)
11+
for more details!
12+
13+
#### :house: Internal
14+
15+
- Fixed compiler error in
16+
[nRF91 sample test app](examples/nrf-connect-sdk/nrf9160/memfault_demo_app)
17+
when compiling with the nRF Connect SDK 1.8 release
18+
119
### Changes between Memfault SDK 0.30.5 and SDK 0.30.4 - May 24, 2022
220

321
#### :rocket: New Features

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BUILD ID: 447316
2-
GIT COMMIT: 77b7799c5
1+
BUILD ID: 451641
2+
GIT COMMIT: 963211879

components/demo/src/http/memfault_demo_http.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,5 @@ const char *memfault_demo_get_api_project_key(void) {
2727
int memfault_demo_cli_cmd_post_core(MEMFAULT_UNUSED int argc,
2828
MEMFAULT_UNUSED char *argv[]) {
2929
MEMFAULT_LOG_INFO("Posting Memfault Data...");
30-
sMfltHttpClient *http_client = memfault_http_client_create();
31-
if (!http_client) {
32-
MEMFAULT_LOG_ERROR("Failed to create HTTP client");
33-
return MemfaultInternalReturnCode_Error;
34-
}
35-
36-
const int rv = memfault_http_client_post_data(http_client);
37-
if ((eMfltPostDataStatus)rv == kMfltPostDataStatus_NoDataFound) {
38-
MEMFAULT_LOG_INFO("No new data found");
39-
} else {
40-
MEMFAULT_LOG_INFO("Result: %d", rv);
41-
}
42-
const uint32_t timeout_ms = 30 * 1000;
43-
memfault_http_client_wait_until_requests_completed(http_client, timeout_ms);
44-
memfault_http_client_destroy(http_client);
45-
return rv;
30+
return memfault_http_client_post_chunk();
4631
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//! @file
2+
//!
3+
//! Copyright (c) Memfault, Inc.
4+
//! See License.txt for details
5+
//!
6+
//! @brief
7+
//! Implements conveninece API for posting a single chunk of Memfault data
8+
9+
#include "memfault/http/http_client.h"
10+
11+
#include "memfault/core/debug_log.h"
12+
#include "memfault/core/errors.h"
13+
#include "memfault/core/data_packetizer.h"
14+
15+
int memfault_http_client_post_chunk(void) {
16+
// A pre-flight check before we attempt to setup an HTTP client
17+
// If there's no data to send, just early return
18+
bool more_data = memfault_packetizer_data_available();
19+
if (!more_data) {
20+
// no new data to post
21+
return kMfltPostDataStatus_NoDataFound;
22+
}
23+
24+
sMfltHttpClient *http_client = memfault_http_client_create();
25+
if (!http_client) {
26+
MEMFAULT_LOG_ERROR("Failed to create HTTP client");
27+
return MemfaultInternalReturnCode_Error;
28+
}
29+
30+
const int rv = memfault_http_client_post_data(http_client);
31+
if ((eMfltPostDataStatus)rv != kMfltPostDataStatus_Success) {
32+
MEMFAULT_LOG_ERROR("Failed to post chunk: rv=%d", rv);
33+
}
34+
const uint32_t timeout_ms = 30 * 1000;
35+
memfault_http_client_wait_until_requests_completed(http_client, timeout_ms);
36+
memfault_http_client_destroy(http_client);
37+
return rv;
38+
}

components/include/memfault/http/http_client.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ typedef enum {
9898
//! if no data was found or else an error code.
9999
int memfault_http_client_post_data(sMfltHttpClient *client);
100100

101+
//! Create a http client, post a chunk of data and then teardown the connection
102+
//!
103+
//! @return kMfltPostDataStatus_Success on success, kMfltPostDataStatus_NoDataFound
104+
//! if no data was found or else an error code.
105+
int memfault_http_client_post_chunk(void);
106+
101107
//! Waits until pending requests have been completed.
102108
//! @param client The http client.
103109
//! @return 0 on success, else error code

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 = 30, .patch = 5 }
22+
#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 31, .patch = 0 }
2323

2424
#ifdef __cplusplus
2525
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ if (NCS_VERSION_MAJOR)
3838
set(CONFIG_NEWLIB_LIBC y CACHE INTERNAL "")
3939
endif()
4040

41-
# These were removed in NCS 1.9, but are needed prior to that.
42-
if (${NCS_VERSION_MAJOR} LESS_EQUAL 1 AND ${NCS_VERSION_MINOR} LESS 9 AND ${NCS_VERSION_PATCH} LESS 99)
41+
# These were removed in NCS 1.8.0, but are needed prior to that. Enable them
42+
# if NCS version <1.7.99 (.99 patch version is used for the next revision's
43+
# development series)
44+
if (${NCS_VERSION_MAJOR}.${NCS_VERSION_MINOR}.${NCS_VERSION_PATCH} VERSION_LESS 1.7.99)
4345
set(CONFIG_BSD_LIBRARY y CACHE INTERNAL "")
4446
set(CONFIG_BSD_LIBRARY_SYS_INIT n CACHE INTERNAL "")
4547
# ^ Note: CONFIG_BSD_ were renamed to _NRF_MODEM_ in
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
NAME := MemfaultHttp
22

3-
$(NAME)_SOURCES := src/memfault_http_client.c \
3+
$(NAME)_SOURCES := \
4+
src/memfault_http_client.c \
5+
src/memfault_http_client_post_chunk.c
46

57

6-
$(NAME)_COMPONENTS := libraries/memfault/core \
7-
libraries/memfault/panics \
8-
protocols/HTTP_client \
9-
8+
$(NAME)_COMPONENTS := \
9+
libraries/memfault/core \
10+
libraries/memfault/panics \
11+
protocols/HTTP_client
1012

1113
$(NAME)_INCLUDES += include
1214

1315
GLOBAL_INCLUDES += include
1416

1517
VALID_OSNS_COMBOS := ThreadX-NetX_Duo FreeRTOS-LwIP
16-
VALID_PLATFORMS := BCM943362WCD4 \
17-
BCM943362WCD6 \
18-
BCM943362WCD8 \
19-
BCM943364WCD1 \
20-
CYW94343WWCD1_EVB \
21-
BCM943438WCD1 \
22-
BCM94343WWCD2 \
23-
CY8CKIT_062 \
24-
NEB1DX* \
25-
CYW9MCU7X9N364 \
26-
CYW943907AEVAL1F \
27-
CYW954907AEVAL1F \
28-
CYW9WCD2REFAD2* \
29-
CYW9WCD760PINSDAD2 \
30-
CYW943455EVB* \
31-
CYW943012EVB*
18+
VALID_PLATFORMS := \
19+
BCM943362WCD4 \
20+
BCM943362WCD6 \
21+
BCM943362WCD8 \
22+
BCM943364WCD1 \
23+
CYW94343WWCD1_EVB \
24+
BCM943438WCD1 \
25+
BCM94343WWCD2 \
26+
CY8CKIT_062 \
27+
NEB1DX* \
28+
CYW9MCU7X9N364 \
29+
CYW943907AEVAL1F \
30+
CYW954907AEVAL1F \
31+
CYW9WCD2REFAD2* \
32+
CYW9WCD760PINSDAD2 \
33+
CYW943455EVB* \
34+
CYW943012EVB*

ports/cypress/psoc6/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Memfault Library for ModusToolbox:tm:
2+
3+
To get started with the Memfault ModusToolbox:tm: port see the integration guide
4+
available [here](https://mflt.io/mtb-integration-guide).

0 commit comments

Comments
 (0)