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.

CC2541: Connecting to the CC2541 (Host Test Release) using Android bluetooth app

Part Number: CC2541
Other Parts Discussed in Thread: CC2640

Hi,

My current setup is this: MCU controlling the CC2541 via HCI commands on one device. The CC2541 is the chip itself (not EM board) and is flashed with HostTestRelease. I have my MCU issuing HCI commands to initialize the bluetooth chip as a peripheral device. However, my next goal is to use my Android device and use a Bluetooth terminal app (IE: Serial Bluetooth Terminal) to send commands to the MCU as well as receive data back from the MCU. So the flow of data is going to be: Send command >> Phone >> Bluetooth >> MCU >> Bluetooth >> Phone >> Get data

I am unable to connect to the CC2541 using the Serial Terminal App as it says "no serial service". How should I proceed? Is the HostTestRelease firmware not appropriate in my situation? Am I supposed to setup a GATT custom profile and issue commands from my phone that way? and if so, how?

PS: I looked at the BLE Serial to bridge project on the wiki, and because I don't have the SmartRF05 board, I cannot do it this way, but if you can point to any code that I can learn from, it would be greatly appreciated.

  • Hi,
    For your application, I highly recommend the CC2640 since there is a UART to BLE Bridge project that matches your data flow:
    processors.wiki.ti.com/.../CC2640_UART_to_BLE_Bridge

    There is also a bridge project for the CC254x:
    processors.wiki.ti.com/.../SerialBLEbridge_V_1.4.1

    Or if you want to go the HostTest path(which is a bit more complicated) you have some resources here:
    processors.wiki.ti.com/.../CC254X_WITH_EXT_MCU

    Best wishes
  • Hi,

    Thank you for your reply. With the way my project is right now, I'd prefer to keep using the CC2541.

    I've studied the CC254X_WITH_EXT_MCU document and looked at processors.wiki.ti.com/.../BLE_HostTest_Add_Cmds on how to add additional commands to the HostTest project but I am still confused. My goal is to:
    1) Create a custom GATT profile in my HostTestRelease project
    2) Send a GATT write command from my phone using BLE Scanner app. I want to tell the GATT server to send bytes of data back to the phone.
    3) Receive the command on my CC2541 and subsequently forward it to to the external MCU
    4) My external MCU receives the command and sends the bytes of data to the phone via bluetooth

    I've looked at a lot of CC254X documents and I'm stuck on step 1). I don't know where to begin on how to create a separate custom GATT profile in the Host Test project. Any help or documents I can refer to?

    UPDATE: I looked into the Simple GATT Profile used for the BLE_Bridge projects and realized this could be a viable option. Would my next step be to integrate the SimpleGATTProfile into Host Test like how BLE_Bridge does? What do you think?

  • Hi Zahid

    So I've successfully implemented custom services to the Host Test Release project. I can confirm this because when I flash it onto my CC2541, and then connect to it on my phone, I can access the Custom Services under the Generic Attributes and Generic Access.

    The problem is now, I can send a write request from my phone to the CC2541 using one of the custom characteristics, but I can't see it on my MCU. Is there a way to send these GATT characteristics to the CC2541 and then forward it via HCI Command to my MCU?

    Thanks