Skip to content

Commit d5f0b2d

Browse files
committed
modules: Remove memfault module
Remove memfault module, all needed Memfault is now included in NCSs integration. Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent 1e01a65 commit d5f0b2d

15 files changed

+70
-401
lines changed

app/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ add_subdirectory(src/modules/button)
2424
add_subdirectory_ifdef(CONFIG_APP_BATTERY src/modules/battery)
2525
add_subdirectory_ifdef(CONFIG_APP_ENVIRONMENTAL src/modules/environmental)
2626
add_subdirectory_ifdef(CONFIG_APP_LED src/modules/led)
27-
add_subdirectory_ifdef(CONFIG_APP_MEMFAULT src/modules/memfault)
2827
add_subdirectory_ifdef(CONFIG_APP_SHELL src/modules/shell)
2928

30-
# Include Memfault configuration folder
31-
zephyr_include_directories(config)
32-
3329
if (CONFIG_NRF_CLOUD_COAP_SEC_TAG GREATER_EQUAL 2147483648 AND CONFIG_NRF_CLOUD_COAP_SEC_TAG LESS_EQUAL 2147483667)
3430
message(WARNING "CONFIG_NRF_CLOUD_COAP_SEC_TAG is set to a developer security tag. "
3531
"TLS traffic can now be decrypted with Nordic tools. "

app/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ rsource "src/modules/led/Kconfig.led"
2121
rsource "src/modules/app/Kconfig.app"
2222
rsource "src/modules/fota/Kconfig.fota"
2323
rsource "src/modules/environmental/Kconfig.environmental"
24-
rsource "src/modules/memfault/Kconfig.memfault"
2524
rsource "src/modules/shell/Kconfig.shell"
2625
rsource "src/modules/button/Kconfig.button"
2726

app/boards/thingy91x_nrf9151_ns.conf

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CONFIG_APP_BATTERY=y
1515

1616
# LED module
1717
CONFIG_APP_LED=y
18+
CONFIG_APP_LED_LOG_LEVEL_DBG=y
1819

1920
# Fuel Gage
2021
CONFIG_NRF_FUEL_GAUGE=y
@@ -23,6 +24,7 @@ CONFIG_NPM1300_CHARGER=y
2324
# Wi-Fi
2425
CONFIG_WIFI=y
2526
CONFIG_WIFI_NRF70=y
27+
CONFIG_WIFI_NRF70_LOG_LEVEL_ERR=y
2628
CONFIG_WIFI_NRF70_SKIP_LOCAL_ADMIN_MAC=y
2729
CONFIG_NRF70_BH_WQ_STACK_SIZE=1024
2830
CONFIG_NRF70_IRQ_WQ_STACK_SIZE=1024

app/boards/thingy91x_nrf9151_ns.overlay

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
/ {
1414
chosen {
15-
nordic,modem-trace-uart = &uart1;
1615
zephyr,wifi = &nordic_wlan0;
1716
};
1817
};

app/config/memfault_platform_config.h

-7
This file was deleted.

app/config/memfault_trace_reason_user_config.def

-12
This file was deleted.

app/overlay-memfault.conf

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
#
2-
# Copyright (c) 2024 Nordic Semiconductor
2+
# Copyright (c) 2025 Nordic Semiconductor
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
CONFIG_APP_MEMFAULT=y
8-
CONFIG_APP_MEMFAULT_LOG_LEVEL_DBG=y
9-
CONFIG_MEMFAULT_NCS_DEVICE_ID_IMEI=y
10-
CONFIG_MEMFAULT_NCS_PROJECT_KEY=""
11-
CONFIG_MEMFAULT_LOGGING_RAM_SIZE=4096
7+
CONFIG_MEMFAULT=y
128
CONFIG_MEMFAULT_HEAP_STATS=y
13-
CONFIG_MEMFAULT_NCS_LOCATION_METRICS=y
14-
CONFIG_MEMFAULT_HTTP_DEDICATED_WORKQUEUE_STACK_SIZE=1560
9+
CONFIG_MEMFAULT_LOGGING_ENABLE=y
10+
CONFIG_MEMFAULT_LOGGING_RAM_SIZE=4096
1511
CONFIG_MEMFAULT_COREDUMP_FULL_THREAD_STACKS=y
12+
CONFIG_MEMFAULT_HTTP_DEDICATED_WORKQUEUE_STACK_SIZE=1560
13+
CONFIG_MEMFAULT_HTTP_PERIODIC_UPLOAD=y
14+
CONFIG_MEMFAULT_HTTP_ENABLE=y
1615
CONFIG_MEMFAULT_EVENT_STORAGE_SIZE=2048
1716

17+
# Certificate management
18+
CONFIG_MEMFAULT_ROOT_CERT_STORAGE_NRF9160_MODEM=y
19+
CONFIG_MODEM_KEY_MGMT=y
20+
21+
# Memfault NCS integration
22+
CONFIG_MEMFAULT_NCS_DEVICE_ID_IMEI=y
23+
CONFIG_MEMFAULT_NCS_PROJECT_KEY=""
24+
CONFIG_MEMFAULT_NCS_LOCATION_METRICS=y
25+
CONFIG_MEMFAULT_NCS_LTE_METRICS=y
26+
CONFIG_MEMFAULT_NCS_STACK_METRICS=y
27+
CONFIG_MEMFAULT_NCS_INTERNAL_FLASH_BACKED_COREDUMP=y
28+
CONFIG_MEMFAULT_NCS_POST_COREDUMP_ON_NETWORK_CONNECTED=y
29+
1830
# Memfault depends on POSIX, disable unneeded POSIX features
1931
CONFIG_POSIX_FILE_SYSTEM=n

app/overlay-modemtrace-to-memfault.conf

-15
This file was deleted.

app/prj.conf

-17
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ CONFIG_APP_FOTA_LOG_LEVEL_DBG=y
196196
CONFIG_APP_LOCATION_LOG_LEVEL_DBG=y
197197
CONFIG_APP_CLOUD_LOG_LEVEL_DBG=y
198198
CONFIG_APP_NETWORK_LOG_LEVEL_DBG=y
199-
CONFIG_APP_LED_LOG_LEVEL_DBG=y
200199
CONFIG_APP_SHELL_LOG_LEVEL_DBG=y
201200
CONFIG_APP_LOG_LEVEL_DBG=y
202201

@@ -207,19 +206,3 @@ CONFIG_TASK_WDT_MIN_TIMEOUT=10000
207206

208207
# Device power management
209208
CONFIG_PM_DEVICE=y
210-
211-
# Modem tracing
212-
CONFIG_FCB=y
213-
CONFIG_FLASH_MAP=y
214-
CONFIG_NRF_MODEM_LIB_TRACE=y
215-
CONFIG_NRF_MODEM_LIB_SHELL_TRACE=y
216-
CONFIG_NRF_MODEM_LIB_TRACE_LEVEL_OVERRIDE=y
217-
# Start IP traces after boot with LTE and IP trace level
218-
CONFIG_NRF_MODEM_LIB_TRACE_LEVEL_LTE_AND_IP=y
219-
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_FLASH=y
220-
CONFIG_NRF_MODEM_TRACE_FLASH_NOSPACE_ERASE_OLDEST=y
221-
CONFIG_NRF_MODEM_LIB_TRACE_STACK_SIZE=1024
222-
# Maximum number of sectors that the trace backend can handle
223-
CONFIG_NRF_MODEM_LIB_TRACE_FLASH_SECTORS=255
224-
# Modem trace flash partition size with 255 sectors of 4KB each
225-
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_FLASH_PARTITION_SIZE=0xFF000

app/sample.yaml

+15-11
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@ tests:
1212
sysbuild: true
1313
integration_platforms:
1414
- thingy91x/nrf9151/ns
15+
- nrf9151dk/nrf9151/ns
1516
platform_allow:
1617
- thingy91x/nrf9151/ns
18+
- nrf9151dk/nrf9151/ns
19+
tags: ci_build
20+
app.build.memfault:
21+
build_only: true
22+
sysbuild: true
23+
integration_platforms:
24+
- thingy91x/nrf9151/ns
25+
- nrf9151dk/nrf9151/ns
26+
platform_allow:
27+
- thingy91x/nrf9151/ns
28+
- nrf9151dk/nrf9151/ns
29+
extra_configs:
30+
- CONFIG_MEMFAULT_NCS_PROJECT_KEY="SECRET"
31+
extra_args: EXTRA_CONF_FILE="overlay-memfault.conf;overlay-etb.conf"
1732
tags: ci_build
18-
# app.build.memfault:
19-
# build_only: true
20-
# sysbuild: true
21-
# integration_platforms:
22-
# - thingy91x/nrf9151/ns
23-
# platform_allow:
24-
# - thingy91x/nrf9151/ns
25-
# extra_configs:
26-
# - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY"
27-
# extra_args: EXTRA_CONF_FILE="overlay-memfault.conf;overlay-modemtrace-to-memfault.conf;overlay-etb.conf"
28-
# tags: ci_build
2933
# app.build.bootloader_update:
3034
# build_only: true
3135
# sysbuild: true

app/src/modules/app/app.c

+16-7
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
#include "message_channel.h"
1616
#include "button.h"
1717
#include "network.h"
18-
#include "environmental.h"
1918
#include "cloud_module.h"
2019
#include "fota.h"
2120
#include "location.h"
21+
22+
#if defined(CONFIG_APP_LED)
2223
#include "led.h"
24+
#endif /* CONFIG_APP_LED */
25+
26+
#if defined(CONFIG_APP_ENVIRONMENTAL)
27+
#include "environmental.h"
28+
#endif /* CONFIG_APP_ENVIRONMENTAL */
2329

2430
#if defined(CONFIG_APP_BATTERY)
2531
#include "battery.h"
@@ -236,8 +242,7 @@ static void cloud_disconnected_entry(void *o)
236242

237243
LOG_DBG("%s", __func__);
238244

239-
int err;
240-
245+
#if defined(CONFIG_APP_LED)
241246
/* Blink Yellow */
242247
struct led_msg led_msg = {
243248
.type = LED_RGB_SET,
@@ -248,12 +253,15 @@ static void cloud_disconnected_entry(void *o)
248253
.duration_off_msec = 2000,
249254
.repetitions = 10,
250255
};
251-
err = zbus_chan_pub(&LED_CHAN, &led_msg, K_SECONDS(1));
256+
257+
int err = zbus_chan_pub(&LED_CHAN, &led_msg, K_SECONDS(1));
258+
252259
if (err) {
253260
LOG_ERR("zbus_chan_pub, error: %d", err);
254261
SEND_FATAL_ERROR();
255262
return;
256263
}
264+
#endif /* CONFIG_APP_LED */
257265

258266
k_work_cancel_delayable(&trigger_work);
259267
}
@@ -280,8 +288,7 @@ static void cloud_connected_entry(void *o)
280288

281289
LOG_DBG("%s", __func__);
282290

283-
int err;
284-
291+
#if defined(CONFIG_APP_LED)
285292
/* Blink Green */
286293
struct led_msg led_msg = {
287294
.type = LED_RGB_SET,
@@ -293,12 +300,14 @@ static void cloud_connected_entry(void *o)
293300
.repetitions = 10,
294301
};
295302

296-
err = zbus_chan_pub(&LED_CHAN, &led_msg, K_SECONDS(1));
303+
int err = zbus_chan_pub(&LED_CHAN, &led_msg, K_SECONDS(1));
304+
297305
if (err) {
298306
LOG_ERR("zbus_chan_pub, error: %d", err);
299307
SEND_FATAL_ERROR();
300308
return;
301309
}
310+
#endif /* CONFIG_APP_LED */
302311

303312
k_work_reschedule(&trigger_work, K_NO_WAIT);
304313
}

app/src/modules/cloud/cloud_module.c

+17-8
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
#include "cloud_module.h"
2222
#include "message_channel.h"
2323
#include "network.h"
24+
2425
#if defined(CONFIG_APP_BATTERY)
2526
#include "battery.h"
2627
#endif /* CONFIG_APP_BATTERY */
28+
29+
#if defined(CONFIG_APP_ENVIRONMENTAL)
2730
#include "environmental.h"
31+
#endif /* CONFIG_APP_ENVIRONMENTAL */
2832

2933
/* Register log module */
3034
LOG_MODULE_REGISTER(cloud, CONFIG_APP_CLOUD_LOG_LEVEL);
@@ -38,12 +42,15 @@ LOG_MODULE_REGISTER(cloud, CONFIG_APP_CLOUD_LOG_LEVEL);
3842
#define BAT_MSG_SIZE 0
3943
#endif /* CONFIG_APP_BATTERY */
4044

45+
#if defined(CONFIG_APP_ENVIRONMENTAL)
46+
#define ENV_MSG_SIZE sizeof(struct environmental_msg)
47+
#else
48+
#define ENV_MSG_SIZE 0
49+
#endif /* CONFIG_APP_ENVIRONMENTAL) */
50+
4151
#define MAX_MSG_SIZE (MAX(sizeof(struct cloud_payload), \
4252
MAX(sizeof(struct network_msg), \
43-
MAX(BAT_MSG_SIZE, \
44-
sizeof(struct environmental_msg)))))
45-
46-
53+
MAX(BAT_MSG_SIZE, ENV_MSG_SIZE))))
4754

4855
BUILD_ASSERT(CONFIG_APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS >
4956
CONFIG_APP_CLOUD_EXEC_TIME_SECONDS_MAX,
@@ -56,7 +63,11 @@ ZBUS_MSG_SUBSCRIBER_DEFINE(cloud);
5663
ZBUS_CHAN_ADD_OBS(PAYLOAD_CHAN, cloud, 0);
5764
ZBUS_CHAN_ADD_OBS(NETWORK_CHAN, cloud, 0);
5865
ZBUS_CHAN_ADD_OBS(CLOUD_CHAN, cloud, 0);
66+
67+
#if defined(CONFIG_APP_ENVIRONMENTAL)
5968
ZBUS_CHAN_ADD_OBS(ENVIRONMENTAL_CHAN, cloud, 0);
69+
#endif /* CONFIG_APP_ENVIRONMENTAL */
70+
6071
#if defined(CONFIG_APP_BATTERY)
6172
ZBUS_CHAN_ADD_OBS(BATTERY_CHAN, cloud, 0);
6273
#endif /* CONFIG_APP_BATTERY */
@@ -470,10 +481,6 @@ static void shadow_get(bool delta_only)
470481
return;
471482
} else if (err > 0) {
472483
LOG_WRN("Cloud error: %d", err);
473-
474-
IF_ENABLED(CONFIG_MEMFAULT,
475-
(MEMFAULT_TRACE_EVENT_WITH_STATUS(nrf_cloud_coap_shadow_get, err)));
476-
477484
return;
478485
} else if (err) {
479486
LOG_ERR("Failed to request shadow delta: %d", err);
@@ -566,6 +573,7 @@ static void state_connected_ready_run(void *o)
566573
}
567574
#endif /* CONFIG_APP_BATTERY */
568575

576+
#if defined(CONFIG_APP_ENVIRONMENTAL)
569577
if (state_object->chan == &ENVIRONMENTAL_CHAN) {
570578
struct environmental_msg msg = MSG_TO_ENVIRONMENTAL_MSG(state_object->msg_buf);
571579

@@ -597,6 +605,7 @@ static void state_connected_ready_run(void *o)
597605
return;
598606
}
599607
}
608+
#endif /* CONFIG_APP_ENVIRONMENTAL */
600609

601610
if (state_object->chan == &PAYLOAD_CHAN) {
602611
struct cloud_payload *payload = MSG_TO_PAYLOAD(state_object->msg_buf);

app/src/modules/memfault/CMakeLists.txt

-7
This file was deleted.

app/src/modules/memfault/Kconfig.memfault

-52
This file was deleted.

0 commit comments

Comments
 (0)