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.

CC2642R: Questions for Events after setting AoA parameter and AoA enable

Part Number: CC2642R

Hi, 

I'm running AoA process on CC2642R using SDK version 3.40.00.02.

After BLE connection, I set AoA parameters (by RTLSSrv_setConnCteReceiveParams())

As I know, I can get a event below which confirms above request.

HCI_GAP_EVENT_EVENT > HCI_COMMAND_COMPLETE_EVENT_CODE > HCI_LE_SET_CONNECTION_CTE_RECEIVE_PARAMS

(which is defined in hci_tl.h)

#define HCI_LE_SET_CONNECTION_CTE_RECEIVE_PARAMS          0x2054    //!< opcode of @ref HCI_LE_SetConnectionCteReceiveParams

Here is my questions.

Q) How can I know connection handle from HCI_LE_SET_CONNECTION_CTE_RECEIVE_PARAMS event?

Q) Also, How can I know connection handle from HCI_LE_SET_CONNECTION_CTE_REQUEST_ENABLE event when I set AoA enable?

  • Hi,

    I am assigning an expert to comment on this for you. 

    Regards,
    Michael

  • Hi,

    1) Per BLE Spec (BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 2, Part E, §7.8.83) the return parameters of the HCI_LE_Set_Connection_CTE_Receive_Parameters are the Status and the Connection_Handle. So you will be directly able to access the Connection_Handle when the command complete event will arrive. If needed, you can consult the BLE Spec (BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 2, Part E, §7.7.14) for details on the Command Complete event.

    2) You can take some inspiration from what has been done inside the rtls_master example (see how the function RTLSMaster_enableAoaReq() is called - rtlsAoaEnableReq_t structure keeps track of the connection handle).

    I hope this will help,

    Best regards,

  • Thanks, Clement,

    Your comment is very helpful to me.

    I already look into RTLS sample codes that TI has supported.

    Now I take a closer look at BLE APIs to get a better understanding.

    That's why I asked some questions to you :)


    Anyway, I have one more question.

    I send AoA Enable request every 1 second from the Host (That eventually call RTLSMaster_enableAoaReq())

    and, as a result, I receive I/Q data quite well.

    But, sometimes I didn't receive RTLSSRV_CONNECTION_CTE_IQ_REPORT_EVT event.

    At that time, HCI_LE_SET_CONNECTION_CTE_REQUEST_ENABLE event return status 0x0C (HCI_ERROR_CODE_CMD_DISALLOWED).

    #define HCI_ERROR_CODE_CMD_DISALLOWED 0x0C //!< Command Disallowed)


    Q) When is this error occurred? and How can I avoid it?


    Thanks,

    - Stone

  • Hi,

    The Command Disallowed error code indicates that the command requested cannot be executed because the Controller is in a state where it cannot process this command at this time. This error shall not be used for command OpCodes where the error code Unknown HCI Command is valid. (BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 2, Part D, §2.12)

    In your case, you mentioned you are calling the function RTLSMaster_enableAoaReq() every second. But are you systematically enabling the the CTE request? If yes, then it is not required and I imagine this can cause your issue. Can you verify if this help solving your issue?

    Best regards,

  • Hi, Clement,

    You're right. I got a mistake.

    I call RTLSMaster_enableAoaReq() every 1 second with cteInterval set to 0.
    Now, I changed to call RTLSMaster_enableAoaReq() just once with cteInterval set to 10 (connection interval is 100ms)
    Actually, it works better and I really appreciate that. Thanks.

    Nevertheless, I'm not sure if it works perfectly.
    Sometimes, I got a GAP_LINK_TERMINATED_EVENT with ll_reason is 0x3D (LL_STATUS_ERROR_CONN_TERM_DUE_TO_MIC_FAILURE).
    After reconnecting BLE connection with setting AoA parameters and AoA enable, I can see HCI_LE_SET_CONNECTION_CTE_REQUEST_ENABLE event return status 0x0C.

    In other cases, I can't receive AOA_RESULTS_EVENT after a certain period of time.
    After disconnecting and reconnecting BLE connection with setting AoA parameters and AoA enable, I can see HCI_LE_SET_CONNECTION_CTE_REQUEST_ENABLE event return status 0x0C also.

    Q) How can I avoid it?


    I'll look forward to your precious advice.

    Best regards,

    - Stone

  • Hi,

    I can make the case below much easier with connection interval is 10ms and CTE interval set to 1.

    (The shorter these two interval values, the faster occurring the case)

    > In other cases, I can't receive AOA_RESULTS_EVENT after a certain period of time.
    > After disconnecting and reconnecting BLE connection with setting AoA parameters and AoA enable, I can see HCI_LE_SET_CONNECTION_CTE_REQUEST_ENABLE event return status 0x0C also.

    Best regards,

    - Stone

  • Hi Stone,

    Can you try to rebuild your application using the Release configuration (instead of the Debug configuration)?

    To switch to the Release configuration, click on the small arrow next to the hammer icon and select "Release".

    Kind regards,

  • Hi, Clement,
    I'm sorry that Release mode has the same problem as Debug mode did.
    As I know, there is no difference between Debug mode and Release mode except a compile option (-O4) and it seems not a optimization problem.

    By the way, I got a bus error many times among receiving I/Q data after AoA enable request.
    Here is a exception file that I got using ROV.
    I hope it could be some help.

    Thanks,
    Stone.

    ti.sysbios.family.arm.m3.Hwi.Exception.rod.zip

  • Hi, Clement,

    I have one more question.

    After AoA enable, I call GapScan_enable() periodically (e.g., every 3 seconds).

    Q1) Is it OK to run AoA enable process and Scan process at the same time?

    Q2) If not, how can I get scan result periodically without AoA disable?

    Best regards,

    Stone.

  • Hi,

    Yongsuk Kim said:
    Q1) Is it OK to run AoA enable process and Scan process at the same time?

    Keep in mind you have only one radio (so you cannot be receiving/transmitting data in a connection and at the exact same time scanning). Beside this, it should not be a problem to scan in between the connection events (the BLE stack / the scheduler handles this for you).

    FYI: the rtls_master example can connect several slaves at the same time (so, yes it is possible to keep scanning while in a connection with CTE enabled).

    Regards,

  • Hi, Clement.

    Your reply helped me a lot. Thanks.

    Best regards,

    Stone