cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous BLE connections on WB55

Akos P
Associate II

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.

13 REPLIES 13
Remi QUINTIN
ST Employee

​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 Employee

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
Associate II

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 Employee

​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 Employee

​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
Associate II

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

Remi QUINTIN
ST Employee

​interesting indeed!

I will push your request to our dev team.

@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

BGeig.3
Associate II

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!