Error UART FreeRTOS Driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error UART FreeRTOS Driver

734 Views
PedroCastro
Contributor III

Hi,

I have been using the example freertos_uart program from Kinetis SDK 2 for the TWR-KV31F. The example is pretty straighforward and the only thing I had to do was to configure the Serial USB for the specific baudrate. However, when the demo tries to send the string below, an odd string appears as it would be a encoding problem.

const char *to_send = "FreeRTOS UART driver example!\r\n";

...

/* Send some data */
    if (0 > UART_RTOS_Send(&handle, (uint8_t *)to_send, strlen(to_send)))
    {
        vTaskSuspend(NULL);
    }

After that, when the demo tries to receive something from the terminal with the following function, nothing happens and the software gets stucked in that function.

error = UART_RTOS_Receive(&handle, recv_buffer, sizeof(recv_buffer), &n);

Does anyone know what possibly could be wrong? I am just using an example given and a regular USB-Serial cable.

Thanks in advance

Labels (1)
0 Kudos
1 Reply

458 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Pedro:

This is a normal behavior.

This demo demonstrates the possibility to use the UART driver in the RTOS. The example writes string into, then reads back chars. After every 4B received, these are sent back on UART.

For example, if you send 1234, the console shows

pastedImage_1.png

Regards

Daniel

0 Kudos