New data is added to the settings partition after every reboot.

Hello

I'm using the settings partition to store user configuration data. I know that the BLE stack also uses it — particularly for storing bonding information — but I don't understand why new data keeps getting stored in the settings automatically after each reset (see the orange-highlighted section).

Among these data, I noticed the Bluetooth name (FREEDOM) and the extended advertised name (FREEDOM EXTENDED).

Why do these keys keep appearing after every reset?
After a while, I'm seeing the following error:

opcode 0x2027 status 0x12
Failed to add IRK to controller

Could this be related to the issue I just described?

Thank you in advance.
Best regards,

Parents
  • Hi,

    Normally, device name is not written to settings. However, if you have CONFIG_BT_DEVICE_NAME_DYNAMIC=y and call bt_set_name() it is written. Is that what is happening here? This is also described in this post.

  • Is it possible to avoid calling bt_set_name() to prevent the Bluetooth name from being stored again in the settings partition?

    I tried to add the ble name directly in the advertising data structure : 

    static const struct bt_data non_connectable_data[] = {
    	BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
        BT_DATA(BT_DATA_NAME_COMPLETE, "FREEDOM", 7),
    	BT_DATA(BT_DATA_MANUFACTURER_DATA, complete_advertising_data, sizeof(complete_advertising_data)),
    };
    
    static const struct bt_data connectable_data[] = {
    	BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR),
        BT_DATA(BT_DATA_NAME_COMPLETE, "FREEDOM EXTENDED", 16),
    	BT_DATA(BT_DATA_MANUFACTURER_DATA, lite_advertising_data, sizeof(lite_advertising_data)),
    };

    However, bt_le_ext_adv_set_data still returns error -22 (invalid argument).

Reply
  • Is it possible to avoid calling bt_set_name() to prevent the Bluetooth name from being stored again in the settings partition?

    I tried to add the ble name directly in the advertising data structure : 

    static const struct bt_data non_connectable_data[] = {
    	BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
        BT_DATA(BT_DATA_NAME_COMPLETE, "FREEDOM", 7),
    	BT_DATA(BT_DATA_MANUFACTURER_DATA, complete_advertising_data, sizeof(complete_advertising_data)),
    };
    
    static const struct bt_data connectable_data[] = {
    	BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR),
        BT_DATA(BT_DATA_NAME_COMPLETE, "FREEDOM EXTENDED", 16),
    	BT_DATA(BT_DATA_MANUFACTURER_DATA, lite_advertising_data, sizeof(lite_advertising_data)),
    };

    However, bt_le_ext_adv_set_data still returns error -22 (invalid argument).

Children
No Data
Related