diff --git a/subsys/bluetooth/host/settings.c b/subsys/bluetooth/host/settings.c index abf3d7d81b4311..fcbf72396b8234 100644 --- a/subsys/bluetooth/host/settings.c +++ b/subsys/bluetooth/host/settings.c @@ -217,6 +217,12 @@ static int commit(void) } } + /* Make sure that the identities created by bt_id_create after + * bt_enable is saved to persistent storage. */ + if (!atomic_test_bit(bt_dev.flags, BT_DEV_PRESET_ID)) { + bt_settings_save_id(); + } + if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) { bt_finalize_init(); }