cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-Ms dual role and stack mode

benjaminboschet9
Associate
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
10 REPLIES 10
Scott Löhr
Senior II
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)
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?

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
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.

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

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

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