2020-09-21 11:54 AM
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.
2020-09-21 12:19 PM
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.
2020-09-21 12:21 PM
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.
2020-09-21 12:53 PM
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?
2020-09-22 01:23 AM
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.
2020-09-22 01:54 AM
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
2020-09-23 08:29 AM
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:
/******************************************************************************
* 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
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
2020-09-23 11:19 AM
interesting indeed!
I will push your request to our dev team.
2021-11-03 10:25 AM
@Akos P I notice that this limitation is documented well in the STM32WB BLE stack programming guide, PM0271:
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
2022-11-30 07:08 AM
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!