Skip to main content
Akos P
Associate
September 21, 2020
Question

Simultaneous BLE connections on WB55

  • September 21, 2020
  • 13 replies
  • 5190 views

Hi,

I'm using the STM32WB55 as a BLE peripheral. The goal is to support multiple simultaneous connections with different Centrals, so that the peripheral can broadcast its characteristics to multiple clients.

To accomplish that, my code re-enables advertising after a connection has been established, e.g. in EV_LE_CONN_COMPLETE I call aci_gap_set_discoverable() again.

This works exactly two times (using the custom template generated by CubeMX). However, after the second central connects, additional aci_gap_set_discoverable() calls fail with the error 0x0C.

Any pointers on why this is happening is greatly appreciated.

This topic has been closed for replies.

13 replies

Remi QUINTIN
ST Technical Moderator
September 21, 2020

​The BLE stack is able to connect to 2 central devices and up to 6 peripherals. So it is not possible to extend the number of connection to central devices.

Remi QUINTIN
ST Technical Moderator
September 21, 2020

You can disconnect from one central device and then connect to a new one as lon as the total number of central devices is not higher than 2.

Akos P
Akos PAuthor
Associate
September 21, 2020

Thank you for the quick answer, Remi! Is this limitation documented somewhere? Also, does ST have any plans to change this limit in the foreseeable future?

Remi QUINTIN
ST Technical Moderator
September 22, 2020

​Indeed I did not find this limitation mentioned in the application notes.

No there is no plan to extend the number of connected central devices for now.

Remi QUINTIN
ST Technical Moderator
September 22, 2020

​In fact this is mentionned in the release notes ofthe BLE stack under STM32Cube_FW_WB_V1.8.0\Projects\STM32WB_Copro_Wireless_Binaries\STM32WB5x

  • stm32wb5x_BLE_Stack_full_fw.bin
    • Full BLE Stack 5.0 certified : Link Layer, HCI, L2CAP, ATT, SM, GAP and GATT database
    • BT SIG Certification listing : Declaration ID D042164
      • Following features are kept:
        • GAP peripheral, central (LL slave up to 2 links, LL master up to 6 links)
        • GATT server, client
        • Data length extension
        • 2Mbit PHY / PHY update
        • Privacy / White list
        • Legacy Pairing, LE secure connections
        • HCI interface (full, like stm32wb5x_BLE_HCILayer_fw.bin)
        • Direct Test Mode

  • stm32wb5x_BLE_Stack_light_fw.bin
    • Full BLE Stack 5.0 certified : Link Layer, HCI, L2CAP, ATT, SM, GAP and GATT database
    • BT SIG Certification listing : Declaration ID D042164
    • Wireless Ble stack Light configuration – Slave Only
      • Following features are kept:
        • GAP peripheral only (LL slave up to 2 links)
        • GATT server
        • Data length extension
        • Legacy Pairing
        • HCI interface (reduced)
        • Direct Test Mode

Akos P
Akos PAuthor
Associate
September 23, 2020

Thank you again for your prompt assistance, Remi. If I may, I'd like to suggest to document this limitation in a more visible fashion, rather than the release notes of the firmware file. I believe this is a serious limitation of the ST stack at this point, and knowing this limitation in advance, before committing to the ecosystem saves a lot of headache and frustration for your customers.

In addition, I'd suggest some changes in the example codes and the BLE boilerplate code generated by CubeMX:

  • In app_conf.h, the CFG_BLE_NUM_LINK variable and its description might be misleading:
/******************************************************************************
 * BLE Stack
 ******************************************************************************/
/**
 * Maximum number of simultaneous connections that the device will support.
 * Valid values are from 1 to 8
 */
#define CFG_BLE_NUM_LINK 8
  • In app_ble.c, the Adv_Request() function swallows the return value of aci_gap_set_discoverable(), hiding the fact that the advertisement actually fails.
static void Adv_Request(APP_BLE_ConnStatus_t New_Status)
{
 tBleStatus ret = BLE_STATUS_INVALID_PARAMS;
 
 BleApplicationContext.Device_Connection_Status = New_Status;
 /* Start Fast or Low Power Advertising */
 ret = aci_gap_set_discoverable(
 ADV_TYPE,
 CFG_FAST_CONN_ADV_INTERVAL_MIN,
 CFG_FAST_CONN_ADV_INTERVAL_MAX,
 BLE_ADDR_TYPE,
 ADV_FILTER,
 0,
 0,
 0,
 0,
 0,
 0);
 
 /* Update Advertising data */
 ret = aci_gap_update_adv_data(sizeof(ad_data), (uint8_t*) ad_data);
 
 if (ret == BLE_STATUS_SUCCESS)
 {
 APP_DBG_MSG("Successfully Start Fast Advertising \n" );
 }
 else
 {
 APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret);
 }
 
 return;
}

Thank you again for your help,

Akos

Scott Löhr
Senior III
November 3, 2021

@Akos P​ I notice that this limitation is documented well in the STM32WB BLE stack programming guide, PM0271:

https://www.st.com/resource/en/programming_manual/pm0271-stm32wb-ble-stack-programming-guidelines-stmicroelectronics.pdf

Also to note, it seems abilities have increased to 8 simultaneous connections as a master:

GAP peripheral & Central (8 links - LL slave up to 2 links)

The STM32WB BLE stack multiple master/slave feature offers the capability for one device (called Master_Slave

in this context), to handle up to 8 connections at the same time, as follows:

1. Master of multiple slaves:

– Master_Slave connected up to 8 slaves devices (Master_Slave device is not a slave of any other

master device)

2. Simultaneously advertising/scanning and master of multiple slaves:

a. Master_Slave device connected as a slave to one master device and as a master up to 7 slaves

devices

b. Master_Slave device connected as a slave to two master devices and as a master up to 6 slaves

devices

Remi QUINTIN
ST Technical Moderator
September 23, 2020

​interesting indeed!

I will push your request to our dev team.

BGeig.3
Associate II
November 30, 2022

Hello :)

Any news on this or are the maxmimum allowed connections for the STM32WB55 still 8?

Any plans to increase the max allowed connections?

Thanks!

Remi QUINTIN
ST Technical Moderator
November 30, 2022

No update.

What is your use case that requires more than 8 connections?

BGeig.3
Associate II
November 30, 2022

Uh, thanks for the fast reply Remi :)

We develope some kind of exoskeleton, controlled by myoelectric signals.

Therefore the idea is to build several peripherals (>8) as EMG sensors, sending sensor readings to the central device.

The central device (receiving sensor readings) on the other hand is in peripheral role (-> dual role) connected to a tablet (central device for UI).

Moreover the central device acts as some kind of motor controller, doing even more logic.

Do you have any ST solution ideas (love the WB55)?

Greetings

Benjamin

Remi QUINTIN
ST Technical Moderator
November 30, 2022

Quite interesting!!

The only way I can see is splitting the network architecture in 2 parts, adding on one of the peripheral devices today a role of master to interface with additional 6 or 7 other peripherals devices. This secondary master device would be connected to the first master as a peripheral or/and would directly connect to the tablet using the second peripheral role possible on a device to reduce any latency when displaying data on the UI.