Bonding randomly loss after DFU

Hi there,

I am using nrf connect sdk v2.6.0. I have noticed that after DFU update, I am seeing ble bonding lost randomly on firmware side. I did uncheck Erase Application Settings before DFU and I tried on both Device Manager app as well as nrf connect app and on both Android/IOS. I am attaching dts snippet and prj.conf for reference.

Thanks M

&flash0 {

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 0x0000C000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0x0000C000 0x00076000>;
		};
		slot1_partition: partition@82000 {
			label = "image-1";
			reg = <0x00082000 0x00076000>;
		};

		/*
		 * The flash starting at 0x000f8000 and ending at
		 * 0x000fffff is reserved for use by the application.
		 */

		/*
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */

		app_storage_partition: partition@f8000 {
			label = "appstorage";
			reg = <0x000f8000 0x00006000>;
		};
		storage_partition: partition@fe000 {
			label = "storage";
			reg = <0x000fe000 0x00002000>;
		};
	};
};

6786.prj.conf

Parents
  • Hi, 

    I am seeing ble bonding lost randomly on firmware side.

    Did you add the related codes as this course https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-5-bluetooth-le-security-fundamentals/topic/blefund-lesson-5-exercise-2/?

    I did uncheck Erase Application Settings before DFU and I tried on both Device Manager app as well as nrf connect app and on both Android/IOS.

    Did you check if the "Erase application settings" is disabled every time?

    Regards,
    Amanda H.

  • Hello

    I am facing the same issue. I feel like it is related to the application size even if the settings partition is exactly the same in both partitions manager.

    I explain myself : I programmed 2 different versions (47 and 50) of my BLE peripheral application in 2 application slots of 1 product. Both versions have differences, not related to advertising or pairing, but they ended up not having the same size. I connect my product in v50 to my phone with bounding etc, everything is fine I can reset either my phone or my product and they re connect automaticaly.  When I swap my product in v47 with nRF Connect application for smartphone I can't connect to my phone anymore, I have disconencted reason 19 in the log of my product meaning bouding informations have been lost. But if i swap back my product to v50 I can connect again. 

    Here is screenshots illustrating my words : 

    Screenshot from the programmer of nRF Connect for Desktop, showing both application are of different sizes.

      

    v47 partitions manager

    v50 partitions manager

    My applications are based on sdk v2.5.0.

    May the issue come from the settings_load() function ? Maybe instead of looking to a particular address it is using the difference between the end of the application and the beginning of settings storage partition ?

  • HI, indeed when you go back to the old application you can still connect which means bouding informations are not lost.

  • Please provide a simple project to help reproduce the issue. Do you also see the same issue with v3.1.0?

  • Hi     what I mean is that when I stored bonding info in app_storage_partition instead of default location of storage_partition, I don't see bonding lost after DFU. I tried on latest SDK 3.1.0 and seems to be fine.
    Kind Regards, M

    &flash0 {
    
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x00000000 0x0000C000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0x0000C000 0x00076000>;
    		};
    		slot1_partition: partition@82000 {
    			label = "image-1";
    			reg = <0x00082000 0x00076000>;
    		};
    
    		/*
    		 * The flash starting at 0x000f8000 and ending at
    		 * 0x000fffff is reserved for use by the application.
    		 */
    
    		/*
    		 * Storage partition will be used by FCB/LittleFS/NVS
    		 * if enabled.
    		 */
    
    		app_storage_partition: partition@f8000 {
    			label = "appstorage";
    			reg = <0x000f8000 0x00006000>;
    		};
    		storage_partition: partition@fe000 {
    			label = "storage";
    			reg = <0x000fe000 0x00002000>;
    		};
    	};
    };

  • Moh said:
    I tried on latest SDK 3.1.0 and seems to be fine.

    Sorry, it's not clear to me. Do you mean that the bonding info stored in the default location of storage_partition will not be lost in v3.1.0?

  •  I meant I was previously calling

    /* Retrieve bonded devices */
    bt_foreach_bond(BT_ID_DEFAULT, store_bonded_device, devices);
    to retrieve the stored bonding info which I noticed to lose after DFU and As far as I know, it stores the bonding info at storage_partition of flash. Now I am storing bonding info at app_storage_partition along with storing other app configurations and it seems to retain after DFU
Reply
  •  I meant I was previously calling

    /* Retrieve bonded devices */
    bt_foreach_bond(BT_ID_DEFAULT, store_bonded_device, devices);
    to retrieve the stored bonding info which I noticed to lose after DFU and As far as I know, it stores the bonding info at storage_partition of flash. Now I am storing bonding info at app_storage_partition along with storing other app configurations and it seems to retain after DFU
Children
Related