Skip to main content
DS.4
Senior
May 7, 2024
Solved

Number of bonding/bonded devices and validation ( and typo )

  • May 7, 2024
  • 2 replies
  • 3277 views

For our validation:

I would like to verify my computation for the capacity of the bonding list size. I did have some characteristics created so it's not the default , but its a number close to that. ( Sources in the bottom) 

It would be disastrous if entire bonding list is cleared. (when full, and I need to prevent it )

Also , I do not have the amount of devices to verify that!

 

Please support.

 

Pro bono publico, I also I believe you have a typo in AN5270:

 

DS4_0-1715074921411.png

 

Here are my sources:

 

How many keys stack can hold:
https://community.st.com/t5/stm32-mcus-wireless/how-many-pairing-device-information-can-the-stm32wb-has-at-most/td-p/123506
https://community.st.com/t5/stm32-mcus-wireless/storing-ble-bonding-information-keys-on-external-flash/td-p/120158

How to read the actual key from stack:
https://community.st.com/t5/interface-and-connectivity-ics/where-and-how-to-store-application-security-keys-on-the-bluenrg/m-p/210330

What happens when stack bonding list gets full:
AN5270 : Section: ACI_GAP_CLEAR_SECURITY_DB https://www.st.com/resource/en/application_note/an5270-stm32wb-bluetooth-low-energy-wireless-interface-stmicroelectronics.pdf :

Best answer by Joe_

Hi,
In case NVM is full, only the last bonding is kept and all the previous bonding are deleted (to save space)
Normally there is an hardware_error_event message before NVM is full (NVM_Warning).

By the way, it is possible to get all the devices bond using ACI_GAP_GET_BONDED_DEVICES command.

BR, Joé

2 replies

STTwo-32
Technical Moderator
June 2, 2024

Hello @DS.4 

First, thank you for reporting this Typo, I've escalated it to the concerned team for correction ASAP (under internal ticket number 183137).

For such a specific support, I suggest you contact one of our local FAEs. They should help you on that case.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Joe_Best answer
Technical Moderator
June 5, 2024

Hi,
In case NVM is full, only the last bonding is kept and all the previous bonding are deleted (to save space)
Normally there is an hardware_error_event message before NVM is full (NVM_Warning).

By the way, it is possible to get all the devices bond using ACI_GAP_GET_BONDED_DEVICES command.

BR, Joé

DS.4
DS.4Author
Senior
June 5, 2024

@Joe_  Thanks for that , that exactly what I've seen , saved me a question!

 

For validation, I did manage to fill STM32WB bonding list to max size. Did it by changing my (single) client address on each connection. 

 Issue is that my max size calculation are somehow wrong  !?

 

2 services, UUID_128

each with:

1 charct UUID_128 CCCD ( NOTIF+ INDIC+ READ)

1 charct UUID_128  (WRITE)

 

Set : SHCI_C2_BLE_INIT_OPTIONS_REDUC_GATTDB_NVM and SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC to get maximum free space!

 

So I suppose size of gatt record is 17(UUID length) time two ?

 

according to n = (total_size_of_nvm-1) / [ (size_of_sec_record+1) + (size_of_gatt record+1) ]

 

n  = 2027 / ( 81  +  [(17*2) +1] ??)  = 17 

 

When actually from testing I get max 7.. ( on next bonding  I see what @Joe_  described..)

I also still see the service-changed-descriptor when I discover characteristics.. what I might be missing here?

 

 

 

 

 

 

Technical Moderator
June 6, 2024

Hi,
I just did the calculations with your gatt info, I have the impression that by doing the calculations as if you had a FULL_GATTDB_NVM configuration, we end up with 7 bonded devices max. (see NVM_-_FULL_GATTDB_NVM_flag )
That would be consistent with what you're seeing:
>> "I also still see the service-changed-descriptor when I discover characteristics.. what I might be missing here?"

Are you sure that your configurations on this point are correct?