Skip to content

Commit 0a3f333

Browse files
committed
add patch
1 parent 9088a88 commit 0a3f333

File tree

1 file changed

+119
-0
lines changed

1 file changed

+119
-0
lines changed

patches/peripheral_mds.patch

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
diff --git a/samples/bluetooth/peripheral_mds/Kconfig b/samples/bluetooth/peripheral_mds/Kconfig
2+
index 1a922b3094..fa5f20ff2a 100644
3+
--- a/samples/bluetooth/peripheral_mds/Kconfig
4+
+++ b/samples/bluetooth/peripheral_mds/Kconfig
5+
@@ -4,8 +4,6 @@
6+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
7+
#
8+
9+
-source "Kconfig.zephyr"
10+
-
11+
config SETTINGS
12+
default y
13+
14+
@@ -14,3 +12,55 @@ config ZMS
15+
16+
config NVS
17+
default y if !(SOC_FLASH_NRF_RRAM || SOC_FLASH_NRF_MRAM)
18+
+
19+
+### Memfault Device Identification settings ###
20+
+#
21+
+# There are 3 places device identification is used:
22+
+#
23+
+# | Field | Memfault (NCS) | Bluetooth DIS | MCUboot |
24+
+# |-------------------|-------------------------|--------------------------|------------------------------|
25+
+# | .software_version | MEMFAULT_NCS_FW_VERSION | BT_DIS_FW_REV_STR | MCUBOOT_IMGTOOL_SIGN_VERSION |
26+
+# | .software_type | MEMFAULT_NCS_FW_TYPE | BT_DIS_SW_REV_STR | N/A |
27+
+# | .hardware_version | MEMFAULT_NCS_HW_VERSION | BT_DIS_HW_REV_STR | N/A |
28+
+# | .device_serial | MEMFAULT_NCS_DEVICE_ID | BT_DIS_SERIAL_NUMBER_STR | N/A |
29+
+#
30+
+# How each is used:
31+
+# - Memfault uses these values to tag telemetry data sent to the Memfault cloud.
32+
+# - The Bluetooth Device Information Service (DIS) exposes these values over
33+
+# BLE. These are used by the nRF Connect Device Manager app to execute FOTA
34+
+# with nRF Cloud (Memfault). These values are required when performing the
35+
+# FOTA requests.
36+
+# - MCUboot contains the .software_version in the image header, mostly used for
37+
+# informational purposes.
38+
+#
39+
+# We use this Kconfig override file to set all 3 places simultaneously to ensure
40+
+# consistency.
41+
+
42+
+# .software_version
43+
+config MEMFAULT_NCS_FW_VERSION
44+
+ # The MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_VERSION default uses the VERSION
45+
+ # file for the software version value
46+
+ default MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_VERSION
47+
+config MCUBOOT_IMGTOOL_SIGN_VERSION
48+
+ default MEMFAULT_NCS_FW_VERSION
49+
+config BT_DIS_FW_REV_STR
50+
+ default MEMFAULT_NCS_FW_VERSION
51+
+
52+
+# .software_type
53+
+config MEMFAULT_NCS_FW_TYPE
54+
+ # Defaults to "app"
55+
+ default MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_TYPE
56+
+config BT_DIS_SW_REV_STR
57+
+ default MEMFAULT_BUILTIN_DEVICE_INFO_SOFTWARE_TYPE
58+
+
59+
+# .hardware_version
60+
+config BT_DIS_HW_REV_STR
61+
+ default BOARD
62+
+
63+
+# .device_serial
64+
+config MEMFAULT_NCS_DEVICE_ID
65+
+ default "mfltqs1"
66+
+config BT_DIS_SERIAL_NUMBER_STR
67+
+ default MEMFAULT_NCS_DEVICE_ID
68+
+
69+
+source "Kconfig.zephyr"
70+
diff --git a/samples/bluetooth/peripheral_mds/VERSION b/samples/bluetooth/peripheral_mds/VERSION
71+
new file mode 100644
72+
index 0000000000..397f73e783
73+
--- /dev/null
74+
+++ b/samples/bluetooth/peripheral_mds/VERSION
75+
@@ -0,0 +1,5 @@
76+
+VERSION_MAJOR = 0
77+
+VERSION_MINOR = 0
78+
+PATCHLEVEL = 1
79+
+VERSION_TWEAK = 0
80+
+EXTRAVERSION =
81+
diff --git a/samples/bluetooth/peripheral_mds/prj.conf b/samples/bluetooth/peripheral_mds/prj.conf
82+
index ce2e03b747..c9a5f984b2 100644
83+
--- a/samples/bluetooth/peripheral_mds/prj.conf
84+
+++ b/samples/bluetooth/peripheral_mds/prj.conf
85+
@@ -50,3 +50,27 @@ CONFIG_BT_SETTINGS=y
86+
CONFIG_FLASH=y
87+
CONFIG_FLASH_PAGE_LAYOUT=y
88+
CONFIG_FLASH_MAP=y
89+
+
90+
+# memfault added
91+
+# Essential Memfault configuration
92+
+CONFIG_MEMFAULT=y
93+
+CONFIG_BT_MDS=y
94+
+
95+
+# SMP is a must
96+
+CONFIG_BT_SMP=y
97+
+
98+
+# Enable OTA updates
99+
+CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
100+
+
101+
+# Device Information Service (required for OTA)
102+
+CONFIG_BT_DIS=y
103+
+CONFIG_BT_DIS_SERIAL_NUMBER=y
104+
+CONFIG_BT_DIS_HW_REV=y
105+
+CONFIG_BT_DIS_SW_REV=y
106+
+CONFIG_BT_DIS_FW_REV=y
107+
+
108+
+# Memfault firmware identification
109+
+CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y
110+
+
111+
+# Testing shell
112+
+CONFIG_SHELL=y
113+
diff --git a/samples/bluetooth/peripheral_mds/sysbuild.conf b/samples/bluetooth/peripheral_mds/sysbuild.conf
114+
new file mode 100644
115+
index 0000000000..47f00ff3cf
116+
--- /dev/null
117+
+++ b/samples/bluetooth/peripheral_mds/sysbuild.conf
118+
@@ -0,0 +1 @@
119+
+SB_CONFIG_BOOTLOADER_MCUBOOT=y

0 commit comments

Comments
 (0)