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.

USB Dongle CC2540 connect to iPhone

Other Parts Discussed in Thread: CC2540

Hello there,

i tried to make a connection from the USB-Dongle CC2540 to my iPhone.

It works from my iPhone to the Key-Fob with the SimpleBLEPeriphal.

I flashed this SimpleBLEPeriphal hex.-file on the USB-Dongle - enabled the advertisment programmatically but

the iPhone couldnt find the USB-Dongle. Is there a difference between the keyfob and the usb-dongle microcontroller ?

I thought both are similar even other interface (USB, UART) !!?

Thanks for help

  • Hello Tobias!

    The chip on the USB Dongle and KeyFob are the same, but the hardware on each are different. If you try to load the KeyFob code onto the USB Dongle it will not run. I think it freezes up at the point where it is setting up the 32.768kHz crystal which is not on the Dongle.

    You have to make sure you change the workspace to CC2540 from CC2540DK-MINI-KeyFob.

    Thanks,
  • Hello greenja,


    thanks a lot for your quick reply. I ´ ll try it that way.

    Greetz

    Tobias

  • Hello again :)


    ok the SimplePerpiphal Project supplies a workbench for cc2540. But the advertising is buggy - sometimes the iPhone is able to find

    the cc2540 usb dongle (without connecting btw), sometimes not.

    I saw the TestHost Project provides an USB-driver in HAL. I think i need this driver in the SimplePeriphal project aswell - but i was

    not able to include the USB-driver into the SimplePeriphal project. Do u know how this task is done ?

    Or is it difficult to create an own project with the IAR workbench and inlucde drivers etc as u like ?

    I think TI did offer several template projects to the BLE developers - but how if u like to do your own ?

    Mainly i want to know how i can connect with my iPhone app to the USB dongle cc2540...


    Best regards

    Tobias Alt

  • Hi Tobias,

    The SimpleBLEPeripheral project is not meant to be flashed directly to the CC2540USB dongle. If you need to run the CC2540USB dongle as a peripheral, it's best to flash the CC2540_USBdongle_HostTestRelease_All.hex, then use BTool to initialize the device as a peripheral and set/start advertising. By default Btool configures the dongle as a Central, but you can call GAP_DeviceInit with the peripheral option, followed by the GAP functions to Update Advertising Data & Make Discoverable. These commands are on the Adv Commands tab.

    Best wishes
  • Hello Tobias,

    As JXS suggested, you can use the HostTestRelease profile to get access to the USB.

    The way I did it was to use the CC2540USB and the SimpleBLEPeripheral.
    1. Open both SimpleBLEPeripheral and HostTestRelease.
    2. Create the folders for USB exactly as they appear in HostTestRelease
    3. Add all the files to you folders to match HostTestRelease.
    4. Change the Preprocessor compiler options to match HostTestRelease

    I can't remember why I did it this way, but it worked and everything from there on was just copying the entire project and changing it to suit a new application. I may have left out some steps and there may be another way. I think in the early days I was trying to setup a project from scratch although since then, all my projects have SimpleBLEPeripheral - CC2540USB as the workspace title.

    Thanks,
  • Hello greenja,


    your solution sounds valid but i still didn´t get access with the iPhone to the USB-dongle.

    The way the TI employee described doesn t work aswell with the iPhone.

    Greenja, did you get access with a Smartphone to the USB dongle ?

    I didn´t really understand if you mix up both projects HostTest and Periphal - which APP - file should be called. Although

    in the HostTest the LED can be en/disabled in the Periphal project with the right preprocesser includes - it doesnt change the LED states.

    Or if it is no problem for you i would like to see your Template-Project (if Smartphone access is provided).

    Thanks a lot for your help

    Tobias

  • update: with the BLETool i had succees to discover the USB - dongle with the iPhone.

    THX TI employee for your help !
  • So....finally it works all.

    Greenja your help with the preprocesser config was necessary - thx a lot.

    The big mistake was that my custom app didnt scan the sample.

    The TI app works in all cases.

    Now i have to rework my custam iOS application.

    Nice that support here.

    Greetz

    Tobias