This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Preserved Data, Pstorage and DFU

I've developed my BLE application that is based on nRF518822 and softdevice S110 v.8.0.0. I've defined 6 services (4 with 2 characteritics each and 2 with 1 characteristic each). I use Pstorage to save my own data: I have up to 100 blocks of 32bytes => I need 4 pages to store all these data. According to this, I have configured the following parameters to fulfill my requirements:

  • PSTORAGE_MAX_APPLICATIONS 5
  • DM_GATT_CCCD_COUNT 9
  • DEVICE_MANAGER_APP_CONTEXT_SIZE 4
  • DEVICE_MANAGER_MAX_BONDS 7
  • DFU_APP_DATA_RESERVED 0x1800

Taking into account this information:

  • I can save my data to flash, read them and data are preserved when updating application via DFU.
  • I'm using pairing with static passkey and here is the point when my problem appears: when my device is advertising, I can connect with it (Master Control Panel, for instance), and then I can bond my device when I introduce the defined (and fixed) passkey. The problem is that bonding information is not saved because if either my device (peripheral) or the central device is disconnected, then I'm asked to introduce passkey again when connecting. I have debugged my application and, when I'm bonding my device with a central, I always get the DM_DEVICE_CONTEXT_FULL error. This explains why bonding information is not saved but I do not know what I have this behaviour. Take into account that I proceed in the following way, so bonding table is empty: 1.- Erase full device 2.- Program Bootloader + SoftDevice + MyApp Any suggestion will be very wellcomed. Thanks
Related