How to implement RTS/CTS flow control correctly with Cypress Library

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Justy
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi, 

We are validating RTS/CTS flow control of UART vendor mode on CYUSB236 EVK by sending a 7MB text file from SCB0 to SCB1. With referring to Cypress USB API document, we develop a program via Cypress Linux library to send, receive data, enable RTS/CTS flow control and register CTS notification callback function.

With RTS/CTS flow control enabled on both UART ports, the receiver(SCB1) showed some packets loss as transmitter(SCB0) just continuously sent data without knowing how to check CTS status.

We can’t find any Cypress document or sample codes of handling CTS via Cypress library on CYUSB236 or CY7C65215 website. 

Could you provide document or sample codes of implementing RTS/CTS flow control correctly via Cypress library to prevent packets loss on receiver ?

 

Best Regards,

Justy Huang

0 Likes
1 Solution
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Justy,

Apologies for the delay in response. I tested the source code provided by you and the total received bytes are always identical to the sent bytes.

rts_cts.png

Can you please confirm if you start receiving the data before sending data?

Regards,

Meghavi

View solution in original post

0 Likes
5 Replies
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Justy,

Can you please provide the following details:

1) Which driver you are using?

2) Please let us know the configuration like baud rate, bits, flow control, etc.

Regards,

Meghavi

0 Likes
lock attach
Attachments are accessible only for community members.
Justy
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi Meghavi,

1) Attached 'CyUSBSerial_SDK_Linux.zip' is the library we have used for implementing UART vendor mode flow control on CYUSB236 EVK. File 'CyUSBSerail_SDK_Linux\linux\testUtility\Test_Utility.c' in that attached contains all the codes we implemented for enabling RTS/CTS flow control, data Tx/Rx ...etc.

2) Attached PPT contains detailed setup for UART vendor mode flow control validation on CYUSB236 and UART config of two ports on CYUSB236 are: 

Baud rate:1Mbps,  Data width:8 bits,  Stop bit:1,  Parity:None

 

Best Regards,

Justy Huang

0 Likes
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Justy,

Apologies for the delay in response. 

Can you please confirm if you have referred the cyuart.c which is present in USB_Serial SDK: USB-Serial SDK\linux_driver\CyUSBSerial_SDK_Linux.zip\CyUSBSerial_SDK_Linux\CyUSBSerial_SDK_Linux\linux\library ?

Regards,

Meghavi

0 Likes
Justy
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi Meghavi,

Yes, I referred the APIs in cyuart.c to implement recv and send functions for Cypress UART vendor mode. You can check the source code in attached CyUSBSerial_SDK_Linux.zip\linux\testUtility\Test_Utility.c I implemented for validating HW flow control of Cypress UART vendor mode.

 

Best Regards,

Justy Huang

0 Likes
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Justy,

Apologies for the delay in response. I tested the source code provided by you and the total received bytes are always identical to the sent bytes.

rts_cts.png

Can you please confirm if you start receiving the data before sending data?

Regards,

Meghavi

0 Likes