example code for RTS/CTS flow control (FRDMK64F120)

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

example code for RTS/CTS flow control (FRDMK64F120)

3,516 Views
thivap
Contributor II

Hi

I am working on frdmk64f120 controller. i want to implement flow control in UART. i am using KDS 2.0 IDE and ksdk 1.1.0 mqx examples.

any one give RTS/CTS flow control code reference for me?.

i am using UART-2 pins:

PTD0     -RTS

PTD1     -CTS

PTD2     -RX

PTD3     -TX

thanks and regards,

thiva p

6 Replies

1,452 Views
RadekS
NXP Employee
NXP Employee

Unfortunately UART driver in KSDK 1.1 do not support hardware flow control and version 1.2 will not solve it also.

We also don’t have any example code or modification for adding hardware flow control support to KSDK UART driver.

As free inspiration for your own modifications you can use MQX 4.1.1 (MQX4.2) serial driver which contains hardware flow control support.

I hope it helps you.

Have a great day,
RadekS

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

1,452 Views
thivap
Contributor II

hi Radek

     can you give more detail how to modify that code. what are the file i want to modify and what are the API function

available. if any documentation file there.? please guide me.

thanks and regards,

thiva

0 Kudos

1,452 Views
RadekS
NXP Employee
NXP Employee

Serial driver in MQX 4.1.1 is located at c:\Freescale\Freescale_MQX_4_1\mqx\source\io\serial\

Serial driver in KSDK 1.1 is located at c:\Freescale\KSDK_1.1.0\platform\drivers\src\uart\

Code related to hardware flow control in MQX 4.1.1 serial driver could be detected by occurrence of IO_SERIAL_HW_FLOW_CONTROL macro.

RTS (Request to Send) and CTS (Clear to Send) signals: These two lines allow the receiver and the transmitter to alert each other to their state. A transmitter raises its RTS line, which causes an interrupt on the receiver, i.e - hey can I send some data?. If the receiver is in a position to receive the data it will assert its CTS line, i.e - yes you can start sending.

In fact, you can use also any IO pins for handling RTS,CTS pins instead of hardware feature in UART module.

I hope it helps you.

Have a great day,
RadekS

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

1,452 Views
dave408
Senior Contributor II

RadekS​ I am using a K22F and also need to have hardware flow control enabled.  By any chance has this answer changed?  I understand that KSDK 1.2 doesn't have support.  I read over KSDK 1.3's release notes and don't see anything about hardware flow control there, either.  So is the current solution for everyone to still merge in source from the MQX serial driver?

thivap​ did you ever successfully get  your hardware flow control implemented?

Thanks!

0 Kudos

1,452 Views
RadekS
NXP Employee
NXP Employee

Hi dave408,

I am afraid that this currently still missing even in KSDK 2.0 feature plan. But this plan isn’t still fixed, therefore there is still a chance that it will be in next KSDK version (Unfortunately I cannot promise it).

So, my recommendation is unfortunately still valid.

BTW: I didn't recommend merge MQX serial driver and KSDK code. I recommended using MQX code as inspiration - look on configuration and check where we have to add commands for generating RTS/CTS signals.


I hope it helps you.

Have a great day,
RadekS

1,452 Views
voider
Contributor II

KSDK + MQX have some so usefull drivers, but uart is not the case. No buffer support, not flow control support, no 485 support. Its like a useless driver in real word.

0 Kudos