UART Buffer size problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART Buffer size problem

1,063件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

910件の閲覧回数
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 件の賞賛
返信

910件の閲覧回数
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 件の賞賛
返信

910件の閲覧回数
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 件の賞賛
返信