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.

TIDC-CC2650STK-SENSORTAG: Change uart baudrate on the fly

Part Number: TIDC-CC2650STK-SENSORTAG

Hi, I need some help with UART. 

I need to change the UART Baud Rate dynamically.

At the beginning UART Baud Rate is 300. UART in CallBack mode. After the message is received, my program should respond by sending ybuf array with Baud Rate 300.
After that I close UART, change its baudRate to 9600 and open UART again.
Than my program should respond by sending zbuf array with Baud Rate 9600. Then, whenever a new message arrives, the arrays are sent with Baud Rate 9600.

It works only one time. Function readCallback is no longer called.

The source code of my program is presented below:

static void readCallback(UART_Handle handle, void *rxBuf, size_t size)
 {
    Event_post(eventH, UART_RX_COMPLETE);
 }

void taskFxn(UArg arg0, UArg arg1)
{
    eventH = Event_create(NULL, NULL);

    UART_Handle Uhandle;
    UART_Params Uparams;

    UART_Params_init(&Uparams);
    Uparams.writeDataMode = UART_DATA_BINARY;
    Uparams.readDataMode  = UART_DATA_BINARY;
    Uparams.readMode      = UART_MODE_CALLBACK;
    Uparams.readCallback  = &readCallback;
    Uparams.baudRate      = 300;

    Uhandle = UART_open(Board_UART, &Uparams);
    wantedRxBytes = MBUS_FRAME_DATA_LENGTH;
    UART_control(Uhandle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL);
    UART_read(Uhandle, rxBuf, wantedRxBytes);

    while(true)
    {
        uint16_t events = Event_pend(eventH, Event_Id_NONE, 0xFFFFFFFF, BIOS_WAIT_FOREVER);

        if (events & UART_RX_COMPLETE)
        {
            uint8_t ybuf[3] = {0x1, 0x2, 0x3};
            uint8_t zbuf[3] = {0x4, 0x5, 0x6};

            UART_write(Uhandle, ybuf, 3);
            UART_close (Uhandle);

            Uparams.baudRate=9600;
            Uhandle = UART_open(Board_UART, &Uparams);
            UART_write(Uhandle, zbuf, 3);

            Task_sleep(10000);
            Event_post(eventH, UART_TX_COMPLETE);
        }

        if (events & UART_TX_COMPLETE)
        {
            UART_read(Uhandle, rxBuf, wantedRxBytes);
        }

    }
}



Where could my mistake be? 
Regards, Egor.