FRDM-K64F UART performance

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FRDM-K64F UART performance

2,432 次查看
tzahimanistersk
Contributor I

Hi

I'm using FRDM-K64F board and I need to develop an application that need to support 1 UARTS at 115200.

And intend to use MQX/FreRtos OS.

I've been trying to excecute  the UART driver examples from Kinetis_SDK_v.1.2.0_Demo_Applications.

I've tested all 5  examples (blocking/not blocking/polling/ebme_blocking/edmq_non_blocking) and a bare metal example that I've found in this forum.

The test including a transmission of 115200 data to the default openSDA usp connection.

Yet about 10% of the bytes had not been recived.

I need an example that can demonstrate a perfect performance at 115200 bps. Pfeffered with FreeRTOS.

 

Best Regards

 

    Tzahi Manistersky

标签 (1)
0 项奖励
回复
7 回复数

1,444 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tzahi Manistersky,

Actually these UART demos have been tested before release, and 115200 is not a very high baud rate for a 120MHz part, so would you please tell me details on how to do the test? I am going to reproduce this issue here and try to figure out why. Thanks for your patience!


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,444 次查看
tzahimanistersk
Contributor I

I've done it by using TeraTerm log a file and transmit a 300M size file.

After complition I've compres file size

0 项奖励
回复

1,444 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tzahi Manistersky,

Thanks for the information! I also did the test based on FRDM-K64 with a 10k bytes text file, the example is uart_blocking, but I met another issue, the receiving bytes is more than expected,

44.png

so I guess it is not a serial port issue, but the openSDA CDC driver issue, I am going to test it without the USB CDC port, for example, based on TWR-K64F120M with TWR-SER, and will let you know when I have any result. Thanks for your patience!


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,444 次查看
tzahimanistersk
Contributor I

Hi

I've been able to make reliable looopback functionality by adding the following changes:

1) The main loop:

       // Wait to receive input data

        if (kStatus_UART_Success == UART_DRV_ReceiveDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, OSA_WAIT_FOREVER))

        {

        RxBytesCounter++;

            // Echo received character

//            UART_DRV_SendDataBlocking(BOARD_DEBUG_UART_INSTANCE, &rxChar, 1u, 1000u);

        }

    }

and perform the tx from the UART_DRV_IRQHandler():

void UART_DRV_IRQHandler(uint32_t instance)

{

.

.

.

          /* Get data and put into receive buffer */

            UART_HAL_Getchar(base, uartState->rxBuff);  /*original byte receptin

          

            UART_BWR_C2_TIE(base, 0U);                                /* Addind Disable the transmitter data register empty interrupt */

            UART_HAL_Putchar(base,* uartState->rxBuff);         /*Adding transmit echo

.

This  means that HW is OK but the Tx IRQ handling need some changes.

I need to reduce risks in my projects so I 'd like to know if and wgen I shal have a fix for fsl_uart_driver.c?

0 项奖励
回复

1,444 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tzahi Manistersky,

Thanks for the information!  I agree the HW should be fine, but I don't think you have to modify the code in fsl_uart_driver.c . There is an API called UART_DRV_InstallRxCallback(), and when the callback is installed, it bypasses part of the UART IRQHandler logic. So, the callback needs to handle the indexes of rxBuff, rxSize. and you may do the TX operation there as well.

Hope that helps,


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,444 次查看
tzahimanistersk
Contributor I

I've installed the dev tools for using kinetis design studio followed the steps in Freescale Freedom Development Platform for Ki|Freescale

The FDRM is connected by a USB cable,

I'm runing the UART examples.

After reset and the example's messages' I'm sending a file at 115200 and expecting to re3cieve the same number of bytes' sent.

0 项奖励
回复

1,444 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Tzahi Manistersky,

Thanks for the information! Would you please tell me which tool you used to send the file? HyperTerminal or something like that? Thanks for your patience!


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复