cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

DaRa_4056336
New Contributor II

Hi,

Currently using Neb1DX and I am trying to update BT UART speed from 115200 to 3000000 .

After some searching and reading I found the function bt_host_update_baudrate in bt_firmware.c file.

When I trying to call this function I get Error 85 and 86.

I have some questions:

1. This funtion works?

2 When I need to update the baudrate update command? after wiced_init ? before?

3. is there another working function ?

When I call after wiced init but before BLE init : [setBaudRate 85] VERIFY FAILED

When I call after BLE init: [setBaudRate 86] VERIFY FAILED

Thanks,
David

0 Likes
3 Replies
SheetalJ
Moderator
Moderator
DaRa_4056336
New Contributor II

HI,

Thanks for the answer. I am out from the office until next week.

I will try that next week. Please don't close this thread.

Thanks,
David

0 Likes
DaRa_4056336
New Contributor II

Hi SheetalJ_96

after some debugging I see when I active the command it still don't work and BT stops.

I see that I recieve the correct response but after the correct response the bt don't work...

wiced_result_t setBaudRate(uint32_t newBaudRate){

    hci_event_extended_header_t hci_event;

        char update_command[ 10 ];

        wiced_result_t result;

        WPRINT_APP_INFO(("Start Update BaudRate \n"));

        /* format of transmit bytes for update baud rate command

         * 0x01, 0x18, 0xFC, 0x06, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff

         */

        memcpy( update_command, &hci_commands[ HCI_CMD_UPDATE_BAUDRATE ], 4 );

        update_command[ 4 ] = 0x00; /* Encoded baud rate ; disable : 0 , enable : 1 */

        update_command[ 5 ] = 0x00; /* use Encoded form  ; disable : 0 , enable : 1 */

        /* issue BT hci update baudrate */

        update_command[ 6 ] = ( newBaudRate ) & 0xff;

        update_command[ 7 ] = ( newBaudRate >> 8 ) & 0xff;

        update_command[ 8 ] = ( newBaudRate >> 16 ) & 0xff;

        update_command[ 9 ] = ( newBaudRate >> 24 ) & 0xff;

        VERIFY_RETVAL( bt_bus_transmit( (const uint8_t* ) update_command, 10 ) );

        VERIFY_RETVAL( bt_bus_receive( (uint8_t* ) &hci_event, sizeof( hci_event ), 10000 ) );

        VERIFY_RESPONSE( &hci_event, &expected_hci_events[ HCI_CMD_UPDATE_BAUDRATE ], sizeof( hci_event ) );

/*

        result = platform_uart_transmit_bytes(wiced_bt_uart_driver , (const uint8_t*)update_command , 10);

        uint32_t size = sizeof( hci_event );

        result = platform_uart_receive_bytes(wiced_bt_uart_driver , (uint8_t* ) &hci_event , &size , 10000 );

        //VERIFY_RESPONSE( &hci_event, &expected_hci_events[ HCI_CMD_UPDATE_BAUDRATE ], sizeof( hci_event ) );

*/

        wiced_rtos_delay_milliseconds( 40 );

        /* Update host uart baudrate*/

        WPRINT_APP_INFO(("Update BaudRate \n"));

        bt_uart_config.baud_rate = newBaudRate;

        bt_uart_config.flow_control = FLOW_CONTROL_DISABLED;

        result = bluetooth_wiced_init_config_uart( &bt_uart_config );

        if (result != WICED_BT_SUCCESS)

        {

            WPRINT_APP_INFO(( "bt_host_update_baudrate Fail!%d\n", result));

        }else{

            WPRINT_APP_INFO (("BaudRate CHanged %ld\n",bt_uart_config.baud_rate));

        }

        wiced_rtos_delay_milliseconds( 250 );

        return result;

  }

Any ideas?

Thanks,

David

0 Likes