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.

How to use software examples provided by TI along with BLE stack for CC2541?

Other Parts Discussed in Thread: CC2541, CC2650, CC2640

I have the example programs provided by TI through BLE stack v2 for CC2541.

I want to see the CC2541 in my custom board to broadcast it's name. How to do it?

  • Hi,

    For CC2541, you should use BLE stack version 1.4.1. version 2.0 is an earlier BLE stack revision for CC2640/CC2650.

    I would suggest to check out our software developer's guide and starting with simpleBLEPeripheral.

    You can find there is an array for advertising data, which you can change to whatever you want to advertising with.
  • Hi Christin,

    Installed BLE stack version 1.4.1. executed (download and debug button on IAR embedded workbench) the SimpleBLEPeripheral located in C:\Texas Instruments\BLE-CC254x-1.4.1.43908b\Projects\ble\SimpleBLEPeripheral\CC2541DB
    but i don't see any advertising Bluetooth name shown on my mobile phone which has BLE.
  • You need to install BLE app to be able to find the name.

    you can download TI sensortag app or Light blue for doing testing.
  • Hi Christin,

    Running SmipleBLEPeripheral on CC2541,
    Running BLE scanner and/or TI sensorTag app on my android OnePlus X phone.
    Both of them showing No BLE device nearby. distance between our custom board and My phone is within 50cm.
  • When you run debug mode, did you see your device on custom board actually start advertising? Have you checked if your HW is powerup properly? Did you follow the reference design when you designed your own board?

    If you can attach your schematic, our HW experts can take a look at it.
  • If I run in debug mode, the device on custom board is not advertising, and I can confirm by seeing on the apps that you suggested.

    Yes the HW is poweredup properly, and is powered through CC debugger. An LED on board P0_0 is also glowing.

    Yes we've followed the reference design guidelines.

    No, I can't attach my schematic.

  • Thanks Christin,

    After I've used the sample project on BLE in Android Studio, the BLE name being broadcasted is seen on my phone and I'm able to see that same "SimpleBLEBroadcaster" in all the BLE enabled devices I have.

    Further I'm not able to get where to start to communicate betweeen these two devices(Android Phone and CC2541).

    Can you suggest how can I start sending and receiving bytes of information from and to android phone?

  • You can't make connection to device that's runninng simpleBLEBroadcaster. You should use simpleBLEPeripheral if you want to have connection between your phone and the device.
  • Sorry to confuse you, but it's a SimpleBLEPeripheral that I mentioned
  • Then you should be able to connect to it if it's running simpleBLEPeripheral. did you modify that project? if not, the name should not be simpleBLEBroadcaster...

    When you use light blue, you should be able to connect and write to it.
  • Yes Christin, 

    I'm able to connect to the SimpleBLEPeripheral device. I did not modify a single letter in the project "SimpleBLEPeripheral" or any other example projects. I'm able to see and connect to the "SimpleBLEPeripheral" device through BLE scanner app.

    It shows the following services,

    DEVICE INFORMATION, 0x180A, PRIMARY SERVICE

    GENERIC ACCESS SERVICE, 0x1800, PRIMARY SERVICE

    GENERIC ATTRIBUTE SERVICE SERVICE, 0x1801, PRIMARY SERVICE

    CUSTOM SERVICE, 0000FFF0-0000-1000-8000-00805F9B34FB, PRIMARY SERVICE

    Now, my question is how do I change the code in the SimpleBLEPeripheral project backup such that I can change the name "SimpleBLEPeripheral" to my custom advertising name?

    And how do I send some bytes of info of type "char"/"int" to the connecting client, in this case, the android phone.

  • If you take a look at the project, you will find where the name was set. It's set in scanRspData[]. You can change the data you are sending to your phone by modifying some characteristic.

    Please take a look at software developer's guide. It will walk you thru the most simpleBLEPeripheral project.