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.

hci.c location

Does anyone know where I can find "hci.c"? I am using SerialBLEPeripheral project. I looked eveywhere. I am using IAR work bench 8051 version 8.20.

dave

  • Hi,

    Its available in components/ble/host directory path  under your installation folder.

    Regards,

    Arun

  • Hi,
    I looked into components/ble/host but it is not there. All, I found was hci_data, hci_event and hci_tl.

    I am using SimpleBLEPeripheral project using IAR. So, where can I find hci.c after I opened the project in IAR.

    am using TiWi-uB1 without SmartRF05. So, when I try to establish link with it using BTool, it gives me the following . I removed the "Power_Saving" out of the preprocessor and also assigned "HAL_LCD = FALSE". But stillBTool is unable to estanlish the link with TiWi.

    1] : <Tx> - 02:16:36.627
    -Type : 0x01 (Command)
    -Opcode : 0xFE09 (GAP_EstablishLinkRequest)
    -Data Length : 0x09 (9) byte(s)
    HighDutyCycle : 0x00 (Disable)
    WhiteList : 0x00 (Disable)
    AddrTypePeer : 0x00 (Public)
    PeerAddr : B8:9A:14:BB:D6:98
    Dump(Tx):
    01 09 FE 09 00 00 00 B8 9A 14 BB D6 98
    ------------------------------------------------------------------------------------------------------------------------
    [2] : <Rx> - 02:16:36.647
    -Type : 0x04 (Event)
    -EventCode : 0xFF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
    Status : 0x00 (Success)
    OpCode : 0xFE09 (GAP_EstablishLinkRequest)
    DataLength : 0x00 (0)
    Dump(Rx):
    04 FF 06 7F 06 00 09 FE 00
    ------------------------------------------------------------------------------------------------------------------------
    [3] : <Info> - 02:16:37.687
    Device Connected
    Handle = 0x0000
    Addr Type = 0x00 (Public)
    BDAddr = 98:D6:BB:14:9A:B8
    ------------------------------------------------------------------------------------------------------------------------
    [4] : <Rx> - 02:16:37.687
    -Type : 0x04 (Event)
    -EventCode : 0xFF (HCI_LE_ExtEvent)
    -Data Length : 0x13 (19) bytes(s)
    Event : 0x0605 (GAP_EstablishLink)
    Status : 0x00 (Success)
    DevAddrType : 0x00 (Public)
    DevAddr : 98:D6:BB:14:9A:B8
    ConnHandle : 0x0000 (0)
    ConnInterval : 0x0050 (80)
    ConnLatency : 0x0000 (0)
    ConnTimeout : 0x07D0 (2000)
    ClockAccuracy : 0x00 (0)
    Dump(Rx):
    04 FF 13 05 06 00 00 B8 9A 14 BB D6 98 00 00 50
    00 00 00 D0 07 00
    ------------------------------------------------------------------------------------------------------------------------
    [5] : <Info> - 02:16:38.197
    Device Disconnected
    Handle = 0x0000
    Addr Type = 0x00 (Public)
    BDAddr = 98:D6:BB:14:9A:B8
    ------------------------------------------------------------------------------------------------------------------------
    [6] : <Rx> - 02:16:38.197
    -Type : 0x04 (Event)
    -EventCode : 0xFF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x0606 (GAP_TerminateLink)
    Status : 0x00 (Success)
    ConnHandle : 0x0000 (0)
    Reason : 0x3E (Failed To Establish)
    Dump(Rx):
    04 FF 06 06 06 00 00 00 3E
    ------------------------------------------------------------------------------------------------------------------------
  • Hi,

    I am sorry, its components/ble.hci in BLE SDK v1.40. I am not aware of the location of HCI.c/h in TiWi-uB1.

    Regards,
    Arun
  • I am using BLE SDKV1.40. TiWi does not come with software. I can not find hci.c in BLEsdk1 1.40
  • I am using SimpleBLEPeripheral firmware. I am using BLE SDKV1.40. Where is hci.c?
  • Hi,

    The HCI.c is not given out on source. Its available as a library only.

    Is the device advertising when you are trying to connect to it? Do you have a CC debugger to connect to IAR to check if you recieve the Link Established event?

    Regards,
    Arun
  • Yes, the device advertising. BTool get its address. But When I try to establish the link by using "Establish" button. Yes I have a CC debugger . BTool is giving

    Reason : 0x3E (Failed To Establish)

    What does it mean?
  • Normally failed to establish happens because the Btool doesnt find any response back from the slave device. You need to check the gapProfileState variable for its state or put a break point in peripheralStateNotificationCB() to check if you hit this call.

    The moment Btool sends a connection request, it assumes it has entered a connection, but if for some time, the slave doesn't respond, it disconnects with the "Failed to establish Connection".

    Regards,
    Arun
  • Where is peripheralStateNotificationCB() located? What file is it in?
  • Its available in simpleBLEperipheral .c .

    This is the function that will be called whenever the GAP role of the peripheral device changes.

    Regards,
    Arun
  • I found gapProfileState =0x01. I put the togge point at gapProfileState = newState; It seems like the program got stuck at
    return cnt; It seems like stuck at _hal_uart_dma

    #ifndef POWER_SAVING
    if ( (!DMA_PM && (UxUCR & UCR_FLOW)) && (!detectOverflow ) )
    {
    HAL_UART_DMA_SET_RDY_OUT(); // Re-enable the flow asap
    }
    #endif
    return cnt;