Skip to main content
Thomas Roell
Associate III
May 8, 2026
Question

STM32WB BLE configuration / sizing (BLE_MBLOCK_COUNT)

  • May 8, 2026
  • 1 reply
  • 123 views

Ok, a tricky one. 

 

So for services and attributes it's documented that there is 10752 bytes, each service takes up 48 bytes, each attribute 40 bytes, and if you got th number of services and attributes you can compute backwards  BLE_ATT_VALUE_ARRAY_SIZE (after you mapped all characteristics to actual attributes), given the upper limit. Easy enough. (GATT_DB_Size_SRAM_NVM.xlsx)

 

My problem is now BLE_MBLOCK_COUNT. There is this macro:

#define BLE_TOTAL_BUFFER_SIZE(n_link, mblocks_count) \
 (16 + BLE_FIXED_BUFFER_SIZE_BYTES + \
 (BLE_PER_LINK_SIZE_BYTES * (n_link)) + \
 ((BLE_MEM_BLOCK_SIZE + 8) * (mblocks_count)))

What is the limit for BLE_TOTAL_BUFFER_SIZE ? If that is known, I can compute backwards to get "mblock_count" for a known "n_link".

 

Or is the documented 10752 byte number the limit for "BLE_TOTAL_BUFFER_SIZE()" plus the BLE_NUM_GATT_ATTRIBUTES / BLE_NUM_GATT_SERVICES / BLE_ATT_VALUE_ARRAY_SIZE database size ?

1 reply

ST Technical Moderator
July 21, 2026

Hello ​@Thomas Roell ,

The limit for BLE_TOTAL_BUFFER_SIZE is defined in M0 and depends on Soc WB55 or WB15 and on BLE stack type: stack full, stack full extended, stack light etc..

Could you please share these informations ?

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks