Skip to main content
gocchan
Senior
Question

BLE_STATUS_INSUFFICIENT_RESOURCES after bonding

Hello, 

I'm trying to run BLE HID on an STM32WBA23.
I've implemented a process to notify HID reports at 5ms intervals. When connected and bonded, aci_gatt_update_char_value() frequently returns BLE_STATUS_INSUFFICIENT_RESOURCES, preventing timely communication.
When connected but not bonded, BLE_STATUS_INSUFFICIENT_RESOURCES does not occur.
Please explain the reason why the BLE_STATUS_INSUFFICIENT_RESOURCES issue occurs depending on whether bonding is enabled or disabled, and how to resolve it.

Best regards, 
Gotoda
 

2 replies

Explorer

Hi Gotoda, thanks for the clear comparison between bonded and unbonded — that detail really helps narrow it down.

 

With bonding, the link is encrypted, so each 5 ms HID notification carries extra work and the controller's transmit pool can fill up more quickly than it does on an unencrypted link. That would explain why aci_gatt_update_char_value() starts returning BLE_STATUS_INSUFFICIENT_RESOURCES only after bonding, even though the same 5 ms timing works without it.

 

One approach I would try is to treat that return value as back-pressure rather than an error to push through: hold the latest report, wait for the TX pool available event, and only then send the next update. It may also be worth checking whether the negotiated connection interval is actually giving you enough room for a notification every 5 ms once encryption is on, and testing a slightly longer interval to see whether the errors disappear.

 

Does the failure clear straight away if you pause notifications for a short time after the first error, or does it stay stuck until you reconnect?

gocchan
gocchanAuthor
Senior

Hi ​@elizacommunities ,

I added a 1-second pause when BLE_STATUS_INSUFFICIENT_RESOURCES is returned, but the problem persists. The issue is not resolved until the connection is re-established.