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.

Change your BLE USB dongle to slave!

Other Parts Discussed in Thread: CC2540

hello

I just started working on CC2540 mini development kit and I was able to connect the USB dongle to Keyfob.

I tried to make the USB dongle as a slave to be picked up from other BLE devices and nothing is happening? 

The keyfob is recognized by the other BLE device but not the USB dongle! 

Please let me know if there is anything or instructions on how to do this? 

Thanks,

Sam 

  • Hi, check this :)

    To change the configuration as the thread says, go to the list in the upper-left corner in IAR.

  • Hi Sam,

    After you have programmed with "CC2540USB Slave" configuration as Kazola said, you will have to control the CC2540USB from an PC Application. In BTool you can check out the "Adv. Command" tab and look at the GAP commands. First of all you need to configure the device as peripheral (If you want it to be a slave) through the GAP_DeviceInit command. After the device is initiated you can use GAP_MakeDiscoverable  command to start advertising and so on...

    Br

  • Hey, 

    I want to do the same thing, but with BLE 1.2, there is no "CC2540 USB Slave" in the HostTestRelease IAR Project, so how can I make the CC2540 USB dongle acting as a slave with BLE 1.2 ? 

  • same here. I am working on BLE 1.2 and eager to make the USB dongle as the slave. But there is no CC2540 USB Slave in the HostTestRelease IAR project. Please see the attached picture for the screenshot of the IAR interface (There are four options: CC2540USB, CC2540EM, CC2540EM-SBL, CC2540USB-UBL). I have tried all of them and only the CC2540USB will work as a master for the usb dongle and display the messages fluently.

  • Hey Micfox,

    I found a way to make the USB CC2540 acting as a slave, folow these steps :

    1 - Under the TOOLS directory in IAR project (on the left), there is a file named : BuildConfig.cfg, open it

    2 - De-comment DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG and comment the rest like this :

    // BLE Host Build Configurations

    //-DHOST_CONFIG=PERIPHERAL_CFG
    //-DHOST_CONFIG=CENTRAL_CFG
    //-DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG
    //-DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG
    -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG

    It means that your CC2540 USB Dongle can work as Central OR Peripheral 

    3 - Rebuild the Project and flash the USB CC2540 dongle with the .hex file generated

    4 - Run BTool, and choose the port COM corresponding to your USB Dongle. When you run it, it automatically configure the CC2540 USB Dongle as central, so you have to configure it manually as Peripheral (you can do it because you have build the project with the 2 possible configuration Central + Peripheral)

    5 - Under Adv. Commands tab, click on "GAP", and than "GAP_DeviceInit", and below configure the parameters like this :

          

     SEND COMMAND

    6 - click on "GAP_UpdateAdvertisingData" and configure the parameters like this :

    SEND COMMAND

    7 - click on "GAP_MakeDiscoverable" to make it discoverable :) and configure the parameters like this:

    SEND COMMAND

    You can now scan with another Central CC2540 USB Dongle and you will see the CC2540 USB Dongle that you have configured in the slaves list.

    Good luck !!! 

     

  • Thanks Oscar. Could you please advise how to change the  kefob running a certain application (e.g., Keyfobdemo)  as a Master? Thanks

  • Oscar,

         Have you given any thought to using the dongle, configured as a slave, in order to emulate (or simulate or virtualize - I'm something of a tyro and unfamiliar with the preferred terms) a simple BLE peripheral (say one simply advertising Generic Access) for the benefit of a foreign master (such as an iPhone 4S)?

  • Hi, Oscar:

      I tried your approach. It does not work. Another USB dongle fails to detect the peripheral dongle after I manually set up the peripheral dongle as suggested and kept pressing the send command button.

  • Thanks for the instructions. Have you been able to add/modify the GATT Database and/or provide a Characteristic in this mode? (I've installed the CC2540_SmartRF_HostTestRelease_All as I don't have IAR available)

  • Hi, Micfox Micfox:

     I also tried the approach Oscar suggested and it didn't work for me either. I configured a CC2540 USB dongle with "CC2540_USBdongle_HostTestRelease_All.hex" and I configured CC2540 on SmartRF05EB with "CC2540_SmartRF_SimpleBLECentral.hex". I set up CC2540 USB dongle using BTool as Oscar suggested but when I moved up the joystick on the Evaluation board, the LCD display showed "Devices Found 0".

    To check whether the GAP_MakeDiscoverable is appropriately sent or not, I programmed Visual C++ application for serial communication and controlled USB dongle with it. I configured CC2540 on evaluation board with "CC2540_SmartRF_HostTestRelease_All.hex" to control and watch the response of Central using BTool.

    I used exactly same command and parameter as Oscar's, ie "GAP_DeviceInit", "GAP_UpdateAdvertisingData" and "GAP_MakeDiscoverable" for CC 2540 USB Dongle. and I merely pressed  "Scan" button on BTool to have the CC2540 on evaluation board to discover the USB Dongle. Then the USB dongle was discovered and Link Establishment was completed without problem. Just to make sure that the connection is established, I sent GATT_Notification from USB dongle to CC2540 on the board using following command:

    01 9b fd 17 00 00 00 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff

    and I confirmed that the 20 byte value was displayed on the BTool Message Log.

    I can't say for sure but the problem on making the USB dongle act as Peripheral is something to do with the setting of "CC2540_SmartRF_SimpleBLECentral.hex" as I couldn't make a connection with CC2540 with "CC2540_SmartRF_SimpleBLECentral.hex" even though I used the Visual C++ application stated above. Note that this is just a prediction, I'm not so familiar with this device.

    Best regards