Skip to main content
benjaminboschet9
Visitor II
November 3, 2015
Question

BlueNRG-Ms dual role and stack mode

  • November 3, 2015
  • 4 replies
  • 2524 views
Posted on November 03, 2015 at 16:29

Hello,

I'd like to have some clarifcations regarding BLUENRG-MS capacities to handle multiple simultaneous connection as a Master and  Slave device.

From what I undertand, the chip have to configured with Stack Mode 4 (or Mode 3)  to enable simultaneous master / slave / scan / advertize behaviour.

But I can't find exactly which simultaneous connection are possible (for example: connected as a master to 2 devices, and connected as a slave to another device while scan and advertising is still active).

Are the following configurations possible with BlueNRG-MS ?

1) Device(BlueNRG-MS) connected to 1 master, advertising and scanning still active.

2) Device(BlueNRG-MS) connected simultaneously to 2 masters, scanning still active (i.e. able to received advertising data from other devices)

3) Device(BlueNRG-MS) connected simultaneously to 1 master and 1 slave

Is there any document describing the Stack Mode 4 and Mode 3 behavior ?

Thank you

#bluenrg
This topic has been closed for replies.

4 replies

Scott Löhr
Senior III
April 18, 2017
Posted on April 19, 2017 at 00:57

The Programming manual BlueNRG-MS describes a little in 3.10 and all of 4:

http://www.st.com/content/ccc/resource/technical/document/programming_manual/1c/7e/d3/a6/d0/52/4a/35/DM00141271.pdf/files/DM00141271.pdf/jcr:content/translations/en.DM00141271.pdf

 

The sample code describes a little as well:

/**

 * Select the BlueNRG mode configurations.\n

 * @li Mode 1: slave or master, 1 connection, RAM1 only (small GATT DB)

 * @li Mode 2: slave or master, 1 connection, RAM1 and RAM2 (large GATT DB)

 * @li Mode 3: master/slave, 8 connections, RAM1 and RAM2.

 * @li Mode 4: master/slave, 4 connections, RAM1 and RAM2 simultaneous scanning and advertising.

 */

#define CONFIG_DATA_MODE_OFFSET             (0x2D)
rdscliff
Associate III
August 23, 2017
Posted on August 23, 2017 at 22:12

I have a related question about Stack Mode 1 and 2.  What is a 'small GATT DB' vs  'large GATT DB'?  Can one tell when one is exceeding the capabilities of a small GATT DB easily?

grzegorz
Associate III
September 7, 2017
Posted on September 07, 2017 at 12:18

Mode1 - number of attribute records for characteristics is 35

Mode2 - number of attribute records for characteristics is 68

In both cases 9 records are reserved for GAP and GATT services

Quentin Broizat
Associate II
June 5, 2018
Posted on June 05, 2018 at 22:41

Hi everybody, 

I have a question about this stack mode, how can I change this stack mode?

Just with code?

uint8_t stackmode[1];

  stackmode[0] = 0x03;

  ret = aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET,

              CONFIG_DATA_MODE_LEN, 

stackmode);

or there is another step to change that?

I saw there is a file called 'bluing_IFR.c' where we can find this:

#define STACK_MODE              2

#define SLAVE_SCA_PPM           100

#define MASTER_SCA              MASTER_SCA_100ppm

#define HS_STARTUP_TIME_US      800

#define DAY                     13

#define MONTH                   06

#define YEAR                    16

Do I have to change this value to 3 to obtain the stack mode 3?

Thank you for your answers.

Regards.

Antonio Vilei
ST Employee
June 6, 2018
Posted on June 06, 2018 at 12:05

Hi Quentin,

if you want to use stack mode 0x03, you can use the following code:

uint8_t role = 0x03;

ret = aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET, CONFIG_DATA_MODE_LEN, &role);

Please note that you have to call aci_hal_write_config_data() as the first command after reset. If you send other commands before aci_hal_write_config_data(), it will fail.

As for the 'bluenrg_IFR.c' file, you don't need to change that, as it is used only when reprogramming the device flash. Unless you know what you're doing, you don't need to change the IFR configuration.

Best regards,

Antonio

Quentin Broizat
Associate II
June 6, 2018
Posted on June 06, 2018 at 13:51

Hi Antonio,

thank you for your reply, i will try this evening  .

Best regards.

Quentin Broizat
Associate II
June 7, 2018
Posted on June 07, 2018 at 08:26

Hi ! 

Yesterday I tried to connect 2 card (peripheral) on one (central) but it seems to don't working. 

I used the following code just after the reset :

uint8_t role = 0x03;

ret = aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET, CONFIG_DATA_MODE_LEN, &role);

but when i wrote the command 'aci_gap_create_connection' with 2 adresses differentes, my card connect just of them.

Can you help me?

Best regards

Antonio Vilei
ST Employee
June 7, 2018
Posted on June 07, 2018 at 10:16

Hi Quentin,

I'm not sure I fully understand your question, but maybe the following thread could be helpful:

https://community.st.com/0D70X000006SztJSAS

 

Best regards,

Antonio

Quentin Broizat
Associate II
June 8, 2018
Posted on June 08, 2018 at 08:29

Hi Antonio,

it is very helpfull, it will help me to build my code but i don't think that will resolve my problem. What I want is to connect 4 or 5 cards (with 

SPBTLE-RF) to one other, the master. Today i can do only one connection.

Do i have to make a succession of '

aci_gap_create_connection'?

Best regards

Antonio Vilei
ST Employee
June 8, 2018
Posted on June 08, 2018 at 14:09

Hi Quentin,

if you use the

http://www.st.com/en/embedded-software/fp-net-blestar1.html

 software package, you'll be able to have multiple slaves connected to one single master, as shown in the related

http://www.st.com/resource/en/product_presentation/fp-net-blestar1_quick_start_guide.pdf

.

As an alternative, you can use the

http://www.st.com/content/st_com/en/products/embedded-software/wireless-connectivity-software/stsw-bnrgui.html

tool. The BlueNRG GUI includes a set of scripts that you can run by using its built-in interpreter. Starting from the root of the tool installation folder, you can find them in the 'Application\scripts'. You'll find examples for many use cases. For multiple connections, please take a look at the 'Application\scripts\Multiple_Connection' folder.

These scripts are written in Python, but you can easily get inspiration from them for your own C code.

In order to use the GUI, please make sure that your STM32 board is running the

Virtual_COM_Port

 

project of the X-CUBE-BLE1 package.

Best regards,

Antonio