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.

Cannot connect when using GATT_DB_OFF_CHIP configuration

In the HostTestRelease program, you can define GATT_DB_OFF_CHIP to allow your external MCU to set up the attribute table. However, when this is defined, I cannot connect to the device (I am using the tiwi-Ub1 eval kit). I am using an iOS program called LightBlue which simply connects to a BLE device and reads the services and characteristics. When I try to connect without GATT_DB_OFF_CHIP defined, it works fine. But when it is defined, it just hangs when it tries to connect.

I am able to successfully set up a GAP service over HCI and view it using the FindInfoReq command, so it is set up correctly. But it will not connect. Does anyone have any experience with this? 

  • Hi Christopher,

    GATT_DB_OFF_CHIP will require the external MCU to handle most of the GATT DB access. Unfortunately, this includes some service discovery. FindInfo is handled by stack. You should see a ReadByGroupType message or other pop up when iOS apps do discovery. If you are not actively handling this on external CPU, then service discovery will fail.

    See 

    http://processors.wiki.ti.com/index.php/LPRF_BLE_NPGATT

    You might be better off letting BLE stack handle most of the commands, and creating a simple API for just your data portions.

    BR,

    -Greg

  • Thanks for the response Greg! When connecting with the iOS app, I only receive a GAP_EstablishLink event and an ATT_ExchangeMTUReq. There is no ReadByGroupType message that I receive over UART. Should this be an HCI event that I would receive over UART?

    As for making a simple API and letting the stack handle the commands, can this still be done with the gatt database being on the MSP430? I guess I am unsure where to start with this. The LPRF_BLE_NPGATT document shows how to set up an attribute database as I have already done, but it does not show how to handle the service discovery.

  • Christopher,

    I just went through all this as well. Greg helped me find another way as he eluded to in his post. You do not want to go the GATT_DB_OFF_CHIP route. That name is a bit misleading. It really means GATT server and related functionality off chip. I am told they are going to be releasing a version of the HostTestRelease app soon that has a hybrid mode that works more like you would expect, were you just field the data read/write requests and the server functionality remains on the chip.

    However, the other way, is to use the SimpleBLEPeripheral app and setup your table in it. You will need to plumb out the serial port and create a protocol/api between your MCU and the BLE module. Here is a good start:

    http://processors.wiki.ti.com/index.php/SimpleBLEPeripheral_SerialInterface

    Now, there is a catch here, you can not handle the read/write requests over the serial port from the callbacks. It would hang the server. Instead, you could setup 2 characteristics (data pipes, if you will). One characteristic would be write only and the other notify. That essentially gives you an incoming pipe and an outgoing pipe to send and receive packets. It is up to the app on the MCU to assemble/disassemble the packets. 

    Hopefully, this gives you an idea on how best to do yours. FYI, it only a day and a half to get this working, rather than the weeks I spent trying to figure out the other way.

  • Hi,

    You could also check out CC254X WITH EXT MCU, which lists up some ways of doing external control. You could also go for "Network Processor Custom" if you want more explicit control from your external device.

    BR,
    Aslak