This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can CC2540 USB master dongle work with more than one CC2540 Keyfob slaves?

Other Parts Discussed in Thread: CC2540, CC2531, CC2530EM

We are interested in experiments and development with more than one CC2540 Keyfob slave device per a given CC2540 USB master dongle. For example we would like to have several keyfob boards interfaced with tempertature sensors, and communicating with a single USB master dongle, is it possible and what are the limmitations in terms of number of slaves?

Assuming the above is technically possible, any suggestions how can we purchase additional CC2540 Keyfob slave boards from TI? The CC2540DK-MINI development kit comes with only 1 keyfob slave and 1 master USB dongle.

Thank you and best regards,

Robert Morawski

  • This is technically possible per BLE spec (device that plays central role typically talk to one or more peripherals (slaves). However, 

    the CC2540 protocol stack doesn't currently allow this. It is documented in the developer's guide in section 3.3.1

  • I assume that the develper guide in section 3.3.1 refers to so called one "CONNECTION state" instead of BLE specified, seven connection states.

    Can so called "park state" be used to connect more than one slave to the CC2540 master, as outlined in the BLE Core 4.0 spec, quoted below?

    "In addition for using it for low power consumption, park is used to connect more than seven slaves to a single master. At any one time, only seven slaves can be in the CONNECTION state. However, by swapping active and parked slaves out respectively in the piconet, the number of slaves can be much larger (255 if the PM_ADDR is used, and an arbitrarily large number if the BD_ADDR is used)."

    ref. Core_V4.0.pdf, vol2 Core System Package [BR/EDR Controller volume], Part B. Basband Specification, ch. 8.0 Link Controller Operation, sec. 8.9 Park State, p.430

  • Sniff and Park modes do not apply for BLE. They are for classic (BR/EDR) only...

  • Are there any developments or plans to upgrade CC2540 protocol stack (firmware?) to support multi keyob applications? 

    In the meanwhile, are there any alternative suggestions, even if switching from one kefob communicaton to other kefob communicaion from a single master is relatively solw?

  • Robert,

    We are planning to update the CC2540 with the ability to support multiple simultaneous connections, yes. I cannot provide details on schedule etc. in this type of forum.

    As for alternatives, I think that opening and closing connections are your best bet.

    Karl

  • Hi, Karl,

    I've already done a project with Zigbee in which one CC2531 USB Dongle was coordinator and ten CC2530EM were End Device and recently my client asked me to do this job with BLE (one CC2540 USB dongle and ten CC2540 keyfob). So you mentioned CC2540 cannot support multiple simultaneous connections, you mean I cann't do this job?

    if I arrange a procedure in which CC2540 USB dongle sequentially  read CC2540 Keyfob data, can CC2540 BLE stack support that?

    thanks,


  • Younes,

    I would suggest that you read the devices sequentially, opening a connection, reading the data and then closing the connection again. Opening a connection is quite fast in BLE.

    Best regards,

    Karl

  • Hi Karl,

    Thanks for your suggestion.

    one more question please, can two CC2540 USB dongle communicate with each other?

    Thanks,

  • Hi Younes,

    Yes, as long as one is configured as master and the other is configured as slave, nothing prevents this.

    Best regards,

    Karl

  • Hi Karl,

    Thanks, that's great!

    Can the CC2540 USB dongle work in the procedure in which it repeatedly be configure as a master and read data from CC2540 keyfob and then be configure as slave and send data to another CC2540 USB dongle (with master cofiguration)?

    best regards,

     

  • Just want to say something here.

    The keyfob is a peripheral device ie. it plays GAP peripheral role. A peripheral device

    can't scan and initiate a connection. It can only reconnect to a central device (device that

    plays central role) that connected to it previously and provided it the reconnect address.

     

    So, two keyfobs with peripheral firmware can't connect to each other.

  • Dear Karl,

    I am trying your suggestion by sending “GAP_EstablishLinkRequest” commands to 2 keyfobs from 1 USB dongle , and I am having some trouble connecting to the second device after some time has elapsed.  I am using 2 CC2540 Mini Development Kits, loaded with SimpleBLEPeripheral firmware.

    I see that right after performing discovery scan, and setting the default connection settings, I am able to establish and terminate the links with both slaves alternatively, however, if I leave one slave in the connected state for about 10min, and then disconnected, and try to reconnect with the other slave device, the BTOOL will remain in the waiting state to receive the link response from slave until the right button on the slave is pressed. 

    How can I establish link connection with the second slave, after a certain time, without having to press a right button to activate discovery mode? 

    I would like to be able to connect/disconnect to/from different slaves, one a time, on a continuous bases, without having to press any buttons on the keyfobs.  Any suggestions?

    Best Regards,

    Robert.

  • Hi Robert,

    Have you solved that problem yet? If yes, How?

     

    Thanks

    Younes

  • Hello, 

    You may be seeing the following.  The keyfob is setup for limited discoverable mode, and also is not set to default advertising on init.  You can use the settings below to configure this to allow for advertising cont at power up and upon termination.

     

    static uint8 advertData[B_MAX_ADV_LEN] = 

      0x02,   // length of this data

      0x01,   // AD Type = Flags

      0x06,   // gen discoverable & LE only

    }

     

    Also set this, so you don't have to press button on keyfob.

          uint8 initial_advertising_enable = FALSE;

    Br,

    -Greg

     

  • Hi Greg,

    I have two cc2540 mini Development kit. I'm going to connect two USB dongles to two PC and read data from one keyfob as following cycle:

    1- both USB dongle are in the scanning mode.

    2-The  keyfob _1 starts advertising.

    3- The USB dongle_1 connects to keyfob _1 and after data exchange it disconnects keyfob _1.

    4-The  keyfob _1 starts advertising again

    5- The USB dongle_2 connects to keyfob _1 and after data exchange it disconnects keyfob _1.

    My question:  

      Is it possible that  one slave connect to two masters as above steps?

     

    Thanks.

    Younes

  • Any update on when (or if) the CC2540 BLE stack may support multiple connections?

    Thanks

  • Reto,

    Yes, the next release of the BLE stack will support multiple connections. This will be released in the summer. If you need more details, please get in touch with us directly, as we cannot provide more details in a public forum like this.

    Best regards,

    Karl

  • That's fantastic, what's the best way to contact TI directly? If I we go ahead with BLE we need to have certainty that this is possible.


    In the meantime I probably need to use the above mentioned approach (connecting, reading value, disconnecting) for building a prototype. I need to read two sensors in intervals of about 1s.  How would it affect power consumption?  Does the not connecteed slave need to be in discoverable state?

     

    Thanks

     


  • Hi Reto,

    If you are in contact with a TI sales person or FAE, then you can ask them to put you in touch with me. My full name is Karl Torvmark, they should be able to provide contact details.

    The work-around will increase power consumption, as there is some overhead in opening and closing the connection, as opposed to just keeping the connection open. How much is difficult to say without diving into the details.

    Karl

  • Hi Karl


    I tried contacting TI support and ask them to forward the message to you, they suggested to contact you trough the forum. Could you please reply to my question regarding the release date. My support request number is: #1-675228218

    Also could you shed some light on exactly what the difference is between the ble_network_processor_master_pm_off and the ble_single_chip_master_pm_off libraries. From what I understand the network processor is initializing the USB where the single chip is not. Any other major differences?

    Reto

  • Hello,

    The only differences in the build are preprocessor defines 

    xHCI_DISABLE_UART, HCI_UART_BR=3

    So the only diff is the UART.

    An overview of the network processor build is in the software dev guide SWRU271, sec 4.4.

    Br,

    -Greg

     

  • Hi,

    I would be interested in this application. Is the firmware updated already to support multiple simultaneous connections?

    Thanks,

    Flor

  • Hi Flor,

    Yes, the current firmware, BLEv1.1, supports up to 3 simultaneous connections. You can download the latest version at www.ti.com/blestack

    BR

  • Hello Younes,

    Were you able to achieve communication between two CC2540 USB dongle? I am trying to make the dongle act as a peripheral device and become discoverable using BTool. But I am unable to do so.

    Any pointers will be helpful.

    Thanks.

  • Hello,

    To make the USB Dongle act as a slave device you can compile HostTest project  for USBDongle and use slave libraries. The you would send commands from PC to drive it. Something like below.

    Another option is to port simpleBlePeripheral to USBDongle. In this case the USB would just be used to power the device. We don't have example of this port that I'm aware of. 

     

    08:12:11.032 Packet "GAP_DeviceInit", Opcode 0xfe00

    08:12:11.032 Parameters:

    08:12:11.032 | profileRole      : 0x04 (GAP_PROFILE_PERIPHERAL)

    08:12:11.032 | maxScanResponses : 3

    08:12:11.032 | IRK              : "0"

    08:12:11.032 | CSRK             : "0"

    08:12:11.032 | signCounter      : 1

    08:12:11.032 --

    08:12:11.032 Outgoing Dump:

    08:12:11.032     0000: 01 00 fe 26 04 03 00 00 00 00 00 00 00 00 00 00 ...&............

    08:12:11.032     0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    08:12:11.032     0020: 00 00 00 00 00 00 01 00 00 00                   ..........

    08:12:18.640 --

    08:12:18.640 Packet "GAP_UpdateAdvertisingData", Opcode 0xfe07

    08:12:18.640 Parameters:

    08:12:18.640 | adType     : 1 (Advertisement Data)

    08:12:18.640 | dataLen    : 0x08

    08:12:18.640 | advertData : "02:01:04:05:05:05:07:07"

    08:12:18.640 --

    08:12:18.640 Outgoing Dump:

    08:12:18.640     0000: 01 07 fe 0a 01 08 02 01 04 05 05 05 07 07       ..............

    08:12:21.218 --

    08:12:21.218 Packet "GAP_MakeDiscoverable", Opcode 0xfe06

    08:12:21.218 Parameters:

    08:12:21.218 | eventType         : 0x00 (GAP_ADTYPE_ADV_IND)

    08:12:21.218 | initiatorAddrType : 0 (ADDRTYPE_PUBLIC)

    08:12:21.218 | initiatorAddr     : "0":

    08:12:21.218 | channelMap        : 0x07 (Chan 37|Chan 38|Chan 39)

    08:12:21.218 | filterPolicy      : 0x00 (GAP_FILTER_POLICY_ALL)

    08:12:21.218 --

    08:12:21.218 Outgoing Dump:

    08:12:21.218     0000: 01 06 fe 0a 00 00 00 00 00 00 00 00 07 00       ..............

  • Thank you for your quick response.

    I am new to this and hence was looking forward to achieve this using BTool. I have no experience in programming in this domain, hence was wondering if there is any way to do it using BTool? And if not, is there any way to obtain the opcode for various api's?

    I apologize if my question appears naive, but it is because I am a new to this domain.

    Regards.

  • Hi,

    You mentioned flashing the USB with SimpleBlePeripheral.

    I tried this , but the dongle does not seem to be discoverable with this. I have changed few of the flags to make the device discoverable generally (without the press of right button as required on the keyfob). Is it that the code needs configuration of the Dongle different than that of the KeyFob?

    Regards

    Abhijeet