• As mentioned, on Bangle.js 2 we use external flash so we don't touch internal, but even when we do for other boards there is no overlap.

    It might be worth checking the contents of the FD pages - 2x 4096 byte pages, starting at (1024*1024)-(10*4096) and see if they actually change after reboot (I don't think they will). If not it might be that we need to load the info out of them at boot time somehow?

    However I just tested and bonding isn't reset for me...

    • Connect to a Bangle with nRF Connect on Android
    • Tell it to Bond
    • Disconnect/connect - still bonded
    • Disconnect - hard reboot the Bangle
    • Connect - still bonded

    So I think something else must be broken in your case?

  • If it was retaining the bonds the whitelist would be able to resolve the addresses after a reboot and it cannot.
    It appears to be re-learning the bond information after a reboot if there is no whitelist in place to stop it. Doing the steps you described with the whitelist off works the exact same way for me, the "Bonded" text never goes away on nRF Connect because Android retains the bond info irrespective of the watch.

    Please try this:

    • Clear whitelist and disable if on
    • Connect and Bond with Gadgetbridge (If you already have the watch added to gadgetbridge you can bond using Bluetooth settings in android)
    • Disconnect
    • Enable Whitelist, Add Device
    • Connect using Gadgetbridge while Add Device is open (important)
    • Confirm that added address in whitelist is suffixed with public (resolved) and not public or private-resolvable
    • Disconnect and Reconnect a few times in Gadgetbridge to see that you can while the whitelist is enabled
    • Power Off Bangle from settings and turn back on
    • Try to connect with Gadgetbridge, it won't work

    EDIT: Would this code be correct for dumping the 2 pages?

    f = require("Flash");
    
    function dump() {
      pagesize = 4096*2;
      chunksize = 16;
    
      for (let i = 0; i <= pagesize; i += chunksize) {
        fds = f.read(chunksize, (0xf5000 + i));
        hex = [];
        fds.forEach((b) => hex.push(b.toString(16)));
        console.log(hex.join(' '));
      }
    }
    
    setTimeout(dump, 20);
    

    EDIT 2:
    Android seems to stop and start using address privacy seemingly at random, I thought at first nRF Connect disabled it to make development easier, but the real public address (not public (resolved)) started showing up while trying to add to the whitelist with Gadgetbridge.

    If I've done the code above correctly, I can confirm that the FDS pages don't get cleared on reboot which is what should be happening according to Gordon. Something else must be the problem, perhaps somewhere in the whitelist code. I will post more findings soon, I really want to get to the bottom of this.

About

Avatar for user156416 @user156416 started