Skip to main content
JBerg.4
Associate
May 27, 2021
Question

BLE GATT configuration: "Number of Services must be between 1 and 5" -- why?

  • May 27, 2021
  • 8 replies
  • 3705 views

When configuring BLE using STM32CubeIDE Device Configuration Tool with a custom template I can only set up to 5 services and 5 characteristics per service. What is the reason for that?

Is there a possibility to set more services and characteristics per service?

STM32CubeIDE 1.6.1

STM32WB5MM-DK

Thanks!

8 replies

Technical Moderator
June 3, 2021

Hello @JBerg.4​ and welcome to the Community :)

The maximum number of service depending GATT database defined.

So for BLE GATT configuration, define the number of services you need : CFG_BLE_NUM_GATT_SERVICES , and you must add 2 regarding additional mandatory services used by the application (This parameter should be 2 plus the number of user services).

0693W00000Ba1JFQAZ.jpgThis is descrbed in the AN5289 Application note Building wireless applications with STM32WB Series microcontrollers

When your question is answered, please close this topic by choosing "Select as Best". This will help other users find that answer faster.

Imen

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
JBerg.4
JBerg.4Author
Associate
June 7, 2021

Hello Imen,

Thanks for your answer!

Even if i change CFG_BLE_NUM_GATT_SERVICES to 10 the configuration tool doesn't allow me to put a higher number than 5 for the "number of services".

0693W00000BaIM1QAN.png 

I guess it could be a bug of the tool as in the information box of "Number of characteristics", that seems to depend on that maximum number of services, too.

"Parameter of services; maximum is 5"

0693W00000BaIOMQA3.png 

Jonas

Technical Moderator
June 8, 2021

Hi @JBerg.4​ ,

Thanks for your feedback. I will share this with CubeMx team for check.

Hello @Khouloud ZEMMELI​ , @Khouloud OTHMAN​ ,

Can you please check the issue with BLE GATT configuration in CubeMx (as reported by @JBerg.4​ ) and take the necessary actions, or provide explanation if needed.

Thanks,

Imen

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
Khouloud ZEMMELI
ST Employee
June 8, 2021

Hello @Imen DAHMEN​ , Thank you for the mention.

Could you please share your ioc file @JBerg.4​  to check it ?

Thanks, Khouloud

JBerg.4
JBerg.4Author
Associate
June 14, 2021

Hello @Khouloud ZEMMELI​,

Thanks for your answer.

I've created a new project based on the STM32WB5MMG-DK called "BLE_Test" and attached it to this message. (not configured completely yet)

Thanks for your help!

Jonas

Khouloud ZEMMELI
ST Employee
August 17, 2021

Hello @JBerg.4​ 

Sorry for the delay,

I'm back again to inform you that your request is internally under analysis, I'll keep you updated.

Thanks, Khouloud

FDESS.2
Associate II
August 25, 2021

Hello,

To see if the maximum number of services is a limitation of cubeMX, I add manually other services and increased CFG_BLE_NUM_GATT_SERVICES constant to 10, but after 5 call of aci_gatt_add_service() with differents defined services, the 6st call fail with a return code 0x48 (BLE_STATUS_OUT_OF_MEMORY).

I also added manually more than 5 characteritics for one service with aci_gatt_add_char() function, but I didn't reach a limitation in that case.

So is there a limitation in the BLE stack about the number of primary services ? Is it possible to share more memory to increase the number of services ?

Thank you for your help,

Fabien.

Lotta
Associate II
December 9, 2022

Hello @Khouloud ZEMMELI​ ,

Was there any further development on this topic. I too have the problem of services and characteristics both limited to 5 each.

I was able to manually add a 6th characteristic but the changes I had to make were to non-user-editable code and would therefore be a pain to recreate after every code generation for changes to the .ioc file.

Thank you in advance and best regards,

Carlotta

PLind.2
Associate
February 10, 2023

i also struggle here with the maximum number of characteristics possible.

is there any new information?

greets peter

Associate III
February 4, 2024

Any update on this?  I'm seeing the same thing a year later - I can only add up to 5 characteristics per service.