Skip to content

Commit bfc5168

Browse files
author
Memfault Inc
committed
Memfault Firmware SDK 1.3.5 (Build 3944)
1 parent 246a21e commit bfc5168

File tree

13 files changed

+121
-40
lines changed

13 files changed

+121
-40
lines changed

.circleci/Dockerfile

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
2424
ARG MEMFAULT_SDK_APT_DEPS="\
2525
build-essential \
2626
cpputest \
27+
gcc-12 \
28+
g++-12 \
2729
git \
2830
python3.10 \
2931
python3.10-venv\
@@ -32,7 +34,7 @@ ARG MEMFAULT_SDK_APT_DEPS="\
3234
# Run commands and tests as circleci user
3335
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \
3436
echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci && \
35-
apt-get update && apt-get install -y \
37+
apt-get update && apt-get install -y --no-install-recommends \
3638
locales \
3739
sudo \
3840
wget \
@@ -47,11 +49,33 @@ RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \
4749
sudo -u circleci mkdir /home/circleci/project && \
4850
sudo -u circleci mkdir /home/circleci/bin
4951

52+
# Select gcc-12 as the default gcc/g++ version
53+
RUN sudo update-alternatives --install \
54+
/usr/bin/gcc gcc /usr/bin/gcc-12 60 \
55+
--slave /usr/bin/g++ g++ /usr/bin/g++-12 \
56+
--slave /usr/bin/gcov gcov /usr/bin/gcov-12
57+
5058
ENV PATH=/home/circleci/bin:/home/circleci/.local/bin:$PATH \
5159
LANG=en_US.UTF-8 \
5260
LANGUAGE=en_US:en \
5361
LC_ALL=en_US.UTF-8
5462

63+
# Install lcov and add to PATH
64+
ARG LCOV_VERSION=1.16
65+
ARG LCOV_SHA256SUM=987031ad5528c8a746d4b52b380bc1bffe412de1f2b9c2ba5224995668e3240b
66+
RUN \
67+
cd /tmp && \
68+
wget https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz -O lcov.tar.gz && \
69+
echo "${LCOV_SHA256SUM} lcov.tar.gz" | shasum --algorithm=256 --check && \
70+
tar zvxf lcov.tar.gz && \
71+
cd lcov-${LCOV_VERSION} && sudo make install && \
72+
cd .. && \
73+
rm -rf ./lcov* && \
74+
lcov --version && \
75+
genhtml --version
76+
77+
ENV PATH=/home/circleci/lcov-${LCOV_VERSION}/bin:$PATH
78+
5579
USER circleci
5680

5781
# Match the default CircleCI working directory
@@ -60,18 +84,6 @@ WORKDIR /home/circleci/project
6084
# Create the virtualenv
6185
RUN python3 -m venv ~/venv
6286

63-
# Install lcov and add to PATH
64-
ARG LCOV_VERSION=1.14
65-
ARG LCOV_SHA256SUM=14995699187440e0ae4da57fe3a64adc0a3c5cf14feab971f8db38fb7d8f071a
66-
RUN \
67-
cd ~ && \
68-
wget https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz -O ~/lcov.tar.gz && \
69-
echo "${LCOV_SHA256SUM} ${HOME}/lcov.tar.gz" | shasum --algorithm=256 --check && \
70-
cd ~ && tar zvxf ~/lcov.tar.gz && \
71-
rm ~/lcov.tar.gz
72-
73-
ENV PATH=/home/circleci/lcov-${LCOV_VERSION}/bin:$PATH
74-
7587
# Auto-activate the virtualenv in the container
7688
RUN sudo mkdir -p /circleci/ && \
7789
sudo bash -c "echo 'source ~/venv/bin/activate' >> /circleci/.bashrc_circleci" && \

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ version: 2.1
1515
executors:
1616
memfault-ci:
1717
docker:
18-
- image: memfault/memfault-firmware-sdk-ci:0.0.1
18+
- image: memfault/memfault-firmware-sdk-ci:2023-10-13
1919
working_directory: ~/repo
2020

2121
commands:

CHANGES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Memfault Firmware SDK Changelog
22

3+
## [1.3.5] - 2023-10-14
4+
5+
### :chart_with_upwards_trend: Improvements
6+
7+
- ESP-IDF:
8+
9+
- Fix build errors when building the [ESP32 example app](examples/esp32)
10+
project on ESP-IDF versions earlier than v5. This was a regression in
11+
**1.3.4**.
12+
13+
- Conditionally remove a redundant call to `esp_timer_init()` during the
14+
`memfault_boot()` sequence, which was causing a runtime error message. This
15+
call was originally required when `memfault_boot()` was called as part of
16+
ESP-IDF system init, which was disabled by default in **0.31.4** and
17+
deprecated in **0.40.0**. The redundant call was harmless but generated a
18+
nuisance error message.
19+
20+
- Fix another build error in the public unit tests caused by the `-fanalyzer`
21+
flag. The `-fanalyzer` static analyzer was generating a false positive on
22+
GCC 11. Updating the GCC version to 12 removes the false positive.
23+
324
## [1.3.4] - 2023-10-12
425

526
### :chart_with_upwards_trend: Improvements

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 3914
2-
GIT COMMIT: 18179b7fb
3-
VERSION: 1.3.4
1+
BUILD ID: 3944
2+
GIT COMMIT: 429f30930
3+
VERSION: 1.3.5

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 = 3, .patch = 4 }
23-
#define MEMFAULT_SDK_VERSION_STR "1.3.4"
22+
#define MEMFAULT_SDK_VERSION { .major = 1, .minor = 3, .patch = 5 }
23+
#define MEMFAULT_SDK_VERSION_STR "1.3.5"
2424

2525
#ifdef __cplusplus
2626
}

examples/esp32/apps/memfault_demo_app/main/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ list(APPEND
44
cmd_system.c
55
console_example_main.c
66
led.c
7-
settings.c
87
)
98

109
if (CONFIG_APP_MEMFAULT_TRANSPORT_HTTP)
@@ -26,6 +25,14 @@ else()
2625
)
2726
endif()
2827

28+
# include settings.c only on idf >= 4
29+
if("${IDF_VERSION_MAJOR}" VERSION_GREATER_EQUAL 4)
30+
list(APPEND
31+
COMPONENT_SRCS
32+
settings.c
33+
)
34+
endif()
35+
2936
set(COMPONENT_ADD_INCLUDEDIRS
3037
.
3138
memfault

examples/esp32/apps/memfault_demo_app/main/cmd_decl.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ bool wifi_join(const char* ssid, const char* pass);
2222
void wifi_load_creds(char** ssid, char** password);
2323

2424
#define MEMFAULT_PROJECT_KEY_LEN 32
25+
// if gcc < 11, disable -Wattributes, "access" attribute is not supported
26+
#if __GNUC__ < 11
27+
#pragma GCC diagnostic push
28+
#pragma GCC diagnostic ignored "-Wattributes"
29+
#endif
2530
__attribute__((access(write_only, 1, 2))) int wifi_get_project_key(char* project_key,
2631
size_t project_key_len);
27-
32+
#if __GNUC__ < 11
33+
#pragma GCC diagnostic pop
34+
#endif
2835
// Register app-specific console commands
2936
void register_app(void);
3037

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ const int CONNECTED_BIT = BIT0;
4040
typedef nvs_handle nvs_handle_t;
4141
#endif
4242

43-
__attribute__((access(write_only, 1, 2))) int wifi_get_project_key(char* project_key,
44-
size_t project_key_len) {
43+
int wifi_get_project_key(char* project_key, size_t project_key_len) {
4544
// Configurable project key not supported, project key must be compiled in via
4645
// CONFIG_MEMFAULT_PROJECT_KEY
4746
return 1;

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "settings.h"
99

1010
#include <inttypes.h>
11+
#include <stdint.h>
1112
#include <string.h>
1213

1314
#include "argtable3/argtable3.h"
@@ -103,7 +104,10 @@ static esp_err_t prv_open_nvs(nvs_handle_t *nvs_handle) {
103104
return ESP_OK;
104105
}
105106

106-
__attribute__((access(write_only, 2))) int settings_get(enum settings_key key, void *value,
107+
#if __GNUC__ >= 11
108+
__attribute__((access(write_only, 2)))
109+
#endif
110+
int settings_get(enum settings_key key, void *value,
107111
size_t *len) {
108112
if (!prv_settings_key_is_valid(key)) {
109113
ESP_LOGE(__func__, "Invalid key: %d", key);
@@ -163,8 +167,10 @@ __attribute__((access(write_only, 2))) int settings_get(enum settings_key key, v
163167
return err;
164168
}
165169

166-
__attribute__((access(read_only, 2, 3))) int settings_set(enum settings_key key, const void *value,
167-
size_t len) {
170+
#if __GNUC__ >= 11
171+
__attribute__((access(read_only, 2, 3)))
172+
#endif
173+
int settings_set(enum settings_key key, const void *value, size_t len) {
168174
if (!prv_settings_key_is_valid(key)) {
169175
ESP_LOGE(__func__, "Invalid key: %d", key);
170176
return ESP_ERR_INVALID_ARG;
@@ -316,12 +322,14 @@ static int prv_set_cmd(int argc, char **argv) {
316322
break;
317323
case kSettingsTypeI32:
318324
// convert string to int
319-
int32_t i32;
320-
if (sscanf(s_set_args.value->sval[0], "%" SCNi32, &i32) != 1) {
321-
ESP_LOGE(__func__, "Invalid value: %s", s_set_args.value->sval[0]);
322-
return 1;
325+
{
326+
int32_t i32;
327+
if (sscanf(s_set_args.value->sval[0], "%" SCNi32, &i32) != 1) {
328+
ESP_LOGE(__func__, "Invalid value: %s", s_set_args.value->sval[0]);
329+
return 1;
330+
}
331+
err = settings_set(key, &i32, sizeof(i32));
323332
}
324-
err = settings_set(key, &i32, sizeof(i32));
325333
break;
326334
default:
327335
return 1;

examples/esp32/apps/memfault_demo_app/main/settings.h

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include <stddef.h>
1111

12+
#include "memfault/esp_port/version.h"
13+
1214
enum settings_key {
1315
kSettingsWifiSsid,
1416
kSettingsWifiPassword,
@@ -17,8 +19,23 @@ enum settings_key {
1719
kSettingsLedBlinkIntervalMs,
1820
};
1921

20-
__attribute__((access(write_only, 2))) int settings_get(enum settings_key key, void *value,
21-
size_t *len);
22-
__attribute__((access(read_only, 2, 3))) int settings_set(enum settings_key key, const void *value,
23-
size_t len);
22+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
23+
#if __GNUC__ >= 11
24+
__attribute__((access(write_only, 2)))
25+
#endif
26+
int settings_get(enum settings_key key, void *value, size_t *len);
27+
#if __GNUC__ >= 11
28+
__attribute__((access(read_only, 2, 3)))
29+
#endif
30+
int settings_set(enum settings_key key, const void *value, size_t len);
2431
void settings_register_shell_commands(void);
32+
#else // ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
33+
// stub definitions that always fail
34+
static inline int settings_get(enum settings_key key, void *value, size_t *len) {
35+
return -1;
36+
}
37+
static inline int settings_set(enum settings_key key, const void *value, size_t len) {
38+
return -1;
39+
}
40+
static inline void settings_register_shell_commands(void) {}
41+
#endif // ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)

0 commit comments

Comments
 (0)