How to Use HCI Raw Data Mode?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AkJa_4647796
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello AnjanaM_61​,

I am using CYBT-413034-02 module, I ran out of pins, so i have to use HCI Rx nd HCI Tx pin to communicate with ESP8266 module. Can i achieve this using HCI raw data mode.

According to this KBA How to Use HCI Raw Data Mode in CYW20706 - KBA225970

I made all changes according to above KBA, for eg i am sending "XYZ" every one second using

wiced_transport_send_data(0x00,"XYZ",3);

In serial terminal i am receiving XYZ but along with garbage value.

Thank You.

0 Likes
10 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Please notice that the second parameter p_data is the pointer to the payload.

0 Likes

Thank you for your response XinghaoZ_26,

const wiced_transport_cfg_t transport_cfg =

{

    .type = WICED_TRANSPORT_UART,

    .cfg =

    {

        .uart_cfg =

        {

            .mode = WICED_TRANSPORT_UART_RAW_MODE,

            .baud_rate =  115200,

        },

    },

    .rx_buff_pool_cfg =

    {

        .buffer_size = TRANS_UART_BUFFER_SIZE,

        .buffer_count = 2,

    },

    .p_status_handler = NULL,

    .p_data_handler = hci_control_proc_rx_cmd,

    .p_tx_complete_cback = NULL

};

//in receive part i am just making my LED  ON

uint32_t hci_control_proc_rx_cmd( uint8_t *p_buffer, uint32_t length )

{

    wiced_hal_gpio_set_pin_output(WICED_P34, 0);

    return length;

}

but even if i write on PUTTY terminal i don't think the code runs this function hci_control_proc_rx_cmd?

//Transmitting every one second

unsigned char temp_buffer[] = "TDC";

wiced_transport_send_data(0X00,temp_buffer,3);

below is my output on serial terminal,

I receive the "TDC", but after that i get garbage. What could be the issue?

Untitled.png

Thank You.

0 Likes

So the question is not about the HCI Raw Data mode, it is about the SPP transmit function?

Did you test the demo code in the KBA?(How to Use HCI Raw Data Mode in CYW20706 - KBA225970 ) It works fine on my side.

0 Likes

Hello XinghaoZ_26​,

Yes i tried using the demo code How to Use HCI Raw Data Mode in CYW20706 - KBA225970 .

As soon i connect to the PUTTY terminal, my spp test bt connection with mobile gets disconnect.

I am using CYW20719 chip and not CYW20706(the code works fine with cyw20706), I dont want to use spp.

I just want to use HCI Rx nd HCI Tx pin to communicate with ESP8266 module. Can i achieve this using HCI raw data mode.?

Thank you.

Are you using the CYW20719B1 device on the WICED SDK? Or Modus Tool Box?

Could you share the information about the device and SDK you are using? I can try to give you a demo tomorrow.

0 Likes

Hello XinghaoZ_26​,

I am using CYW20719-B1 device on the WICED STUDIO 6.4v.

Thank You.

0 Likes

I just confirmed internally, there is some problem with the HCI Raw data mode on CYW20719B1. Could you try to use the HCI mode? You just need to add a header to your data. The header is introduced in document doc/WICED-HCI-Control-Protocol.pdf as follows:

pastedImage_0.png

You can define your own command and group code for the data.

0 Likes

Thank You for your response XinghaoZ_26​,

The problem is I want to send AT commands for communication, I can't send packets of data. Is there any alternative?

Thank you.

0 Likes

You can also use the HCI mode for AT commands communication. You only need to add a header with your command.

You may refer to the hci_audio_gateway demo. The received HCI data is handled in function hci_control_proc_rx_cmd. You can handle the data as you needed.

0 Likes

Hello XinghaoZ_26​,

I want to communicate with ESP8266, as i am not going to code ESP8266 (using the initial FW which supports AT coomands)

If i try to add header files for eg 0x19 0x00 0x00 0x05 0x00 0x41(A) 0x54(T). The ESP8266 won't take as an AT commands.

Anyways i will try to use Puart pin then.

Thank You.

0 Likes