File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
boot/mcuboot_recovery_entry Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -47,3 +47,9 @@ CONFIG_NRF_SDH_BLE_GATT_MAX_MTU_SIZE=498
47
47
CONFIG_BLE_CONN_PARAMS_MAX_CONN_INTERVAL=24
48
48
CONFIG_BLE_CONN_PARAMS_SUP_TIMEOUT=20
49
49
CONFIG_BLE_CONN_PARAMS_MAX_SUP_TIMEOUT_DEVIATION=20
50
+
51
+ CONFIG_SETTINGS=y
52
+ CONFIG_SETTINGS_RETENTION=y
53
+ CONFIG_SETTINGS_RUNTIME=y
54
+ CONFIG_MCUMGR_GRP_SETTINGS=y
55
+ CONFIG_NCS_BM_SETTINGS_BLUETOOTH_NAME=y
Original file line number Diff line number Diff line change 13
13
#include <zephyr/logging/log_ctrl.h>
14
14
#include <zephyr/mgmt/mcumgr/mgmt/callbacks.h>
15
15
#include <bluetooth/services/ble_mcumgr.h>
16
+ #include <zephyr/settings/settings.h>
16
17
17
18
LOG_MODULE_REGISTER (app , CONFIG_APP_LOG_LEVEL );
18
19
@@ -180,6 +181,14 @@ int main(void)
180
181
return 0 ;
181
182
}
182
183
184
+ err = settings_subsys_init ();
185
+
186
+ if (err ) {
187
+ LOG_ERR ("Failed to enable settings: %d" , err );
188
+ }
189
+
190
+ /* settings_load(); */
191
+
183
192
LOG_INF ("Bluetooth enabled" );
184
193
185
194
err = ble_mcumgr_init ();
Original file line number Diff line number Diff line change 22
22
#include <ble_conn_params.h>
23
23
#include <bluetooth/services/ble_mcumgr.h>
24
24
#include <zephyr/settings/settings.h>
25
+ #include <zephyr/retention/retention.h>
25
26
#include <settings/bluetooth_name.h>
26
27
27
28
LOG_MODULE_REGISTER (app , CONFIG_APP_LOG_LEVEL );
@@ -270,6 +271,14 @@ int main(void)
270
271
return 0 ;
271
272
}
272
273
}
274
+
275
+ /* Clear settings after device name has been set so it does not persist */
276
+ err = retention_clear (DEVICE_DT_GET (DT_CHOSEN (zephyr_settings_partition )));
277
+
278
+ if (err ) {
279
+ LOG_ERR ("Failed to clear retention area, err %d" , err );
280
+ return 0 ;
281
+ }
273
282
}
274
283
275
284
err = ble_adv_start (& ble_adv , BLE_ADV_MODE_FAST );
You can’t perform that action at this time.
0 commit comments