UART buffer problem

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

UART buffer problem

781 Views
PedroCastro
Contributor III

Hi,

 

I am using KSDK 1.3 with KDS 3.2 and I am struggling to receive a variable size array of bytes. I only receive one byte and I cannot get the rest of the array.
I used the function static inline uint8_t UART_HAL_GetRxFifoSize(UART_Type * base) and it returned 0x0 which means only one word in the buffer.

I did not find a way to change it and use UART_DRV_ReceiveData or UART_DRV_ReceiveDataBlocking for a greater number of bytes.

 

How can I solve it?

 

Thanks in advance

Tags (1)
0 Kudos
5 Replies

472 Views
PedroCastro
Contributor III

Daniel Chen,

did you find any reference about this?

0 Kudos

472 Views
danielchen
NXP TechSupport
NXP TechSupport

We have uart demos under the KSDK installation folder, you can refer to it.

KSDK_1.3.0\examples\frdmkv31f\driver_examples\uart\

You need to specify the number of data words that you going to receive before it can continue

For example, for uart_blocking example,  the specified number is 1.

    // Send/receive blocking function
    while(true)
    {
        // Wait to receive input data
        if (kStatus_UART_Success == UART_DRV_ReceiveDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, OSA_WAIT_FOREVER))
        {
            // Echo received character
            UART_DRV_SendDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, 1000u);
        }
    }

0 Kudos

472 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi:

Sorry I lost tracking of this thread.

From the KV31 reference manual, only uart0 contains 8-entry receive FIFOs,  all other UARTs contains a 1-entry receive FIFOs.

pastedImage_1.png

Do you use uart0 or other?

Regards

Daniel

0 Kudos

472 Views
PedroCastro
Contributor III

Hello Daniel,

I am using KV31F512.

Is there any problem regarding the API usage?

0 Kudos

472 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Pedro Correa de Castro

which chip you are using?

Regards

Daniel

0 Kudos