UART Buffer size problem

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

UART Buffer size problem

1,061 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

0 Kudos
Reply
3 Replies

908 Views
mjbcswitzerland
Specialist V

Hi Pedro

UART_HAL_GetRxFifoSize() returns the physical size of the FIFO in the UART (by reading UARTx_PFIFO). A zero means that the particular device that you are using doesn't have a FIFO.

However, I don't expect this to be an issue since you need to use a software buffer to store reception to and then there is no dependency on the HW used.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
UART: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF

0 Kudos
Reply

908 Views
PedroCastro
Contributor III

So why do I get just one byte from the functions below?

UART_DRV_ReceiveDataBlocking(UART_INSTANCE, message, count, UART_TIMEOUT);

UART_DRV_ReceiveData(UART_INSTANCE, message, count);

I have already validated the channel through a analyzer and the information is reaching the RX pin

0 Kudos
Reply

908 Views
mjbcswitzerland
Specialist V

Hi Pedro

I don't use KSDK 1.3 so don't know the details. If you need to use KSDK 1.3 it may be best to ask at its forum: https://community.nxp.com/community/mcuxpresso/kinetis-software-development-kit 

Regards

Mark

0 Kudos
Reply