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.

CC2340R5: How to let HCI command responses send through UART?

Part Number: CC2340R5

Hi TI members,

Below is my building environment:

Software

Version

Code Composer Studio

12.3.0.00005 

SimpleLink SDK

7.10.00.35

XDCtools

3.62.1.16_core

We are using host_test to test some HCI commands, and we tested with both Btool and another main CPU that our CC2340R5 connected to.

While using Btool, we could see the responses of the commands, but didn't see any responses through UART.

How can we modify the host_test example to send its response to the main CPU through UART?

Thanks.

BR,

  • Hi YW,

    For BTool, it will send some initialization commands to CC2340R5 at the beginning.

    I think, for your host (main CPU), you might need to send at least HCI_Reset command (UART raw data "01 03 0C 00") to CC2340 first. 

  • Hi Jerry,

    May I know what exactly is the response of the HCI command would be?

    I simply print the responses and it showed gibberish like below:

    How did Btool transfer the response to something like this:

    Thanks.

    BR,

  • Hi,

    You should be able to send the same raw RX that is received by btool whenever the raw TX is sent. Can you share the UART settings you are using and how you are sending the commands?

    Best Regards,

    Jan

  • Hi,

    Thanks for helping.

    We use "od" with some options configured to convert the responses and it can be seen the way it was shown on Btool.

    But we also found that the first time we sent the initial command "01 03 0C 00", the response would be vacant.

    Is this an expected behavior that the HCI commands are designed in the host_test project?

    Thanks.

    BR,

  • Hi,

    Can you clarify what the 01 03 0C 00 command should decode to?

    Best Regards,

    Jan

  • Hi,

    According to the 4th line of the snapshot, I thought it should be "04 0E 04 01 03 0C 00", just like what Btool would show after we run 01 03 0C 00.

    What we wonder was why do we need to run it twice, and it would only response after the second try?

    Thanks.

    BR,

  • Hi,

    Are you sending an HCIExt_ResetSystemCmd() before sending any HCI commands? This will reset the board and ensure it is ready to receive HCI commands:

    If not, then can you try sending it first and checking if you still need to send the transmission twice?

    Best Regards,

    Jan

  • Hi,

    Thanks for the advice.

    I tried sending "01 1D FC 01 00" first, but it turned out that it still needed a second attempt to response.

    Is this a solvable issue?

    Thanks.

    BR,

  • Hi,

    Thank you for confirming. This is unexpected behavior. Can you try using btool to send the commands instead to see if we still need to send them twice? The btool software is included with your SDK and may be found here: C:\ti\simplelink_lowpower_f3_sdk_7_10_00_35\tools\ble5stack\btool

    Afterwards, you can connect to your board via UART and send specific commands by using the Advanced Commands menu.

    Best Regards,

    Jan