• 0
birca123

UART - data loss at high speed

Question

Hello,

I’m having problems with sending large amount of data from ZYBO to a computer. For example, when I tried to send image data (640x480) at the maximum baud rate, the computer didn’t receive all data. But when baud rate was set to 256000, all data were received. It seems like UART buffer is overflowing. How to solve this problem?

Best regards,

Toni

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @birca123,

This article breaks down the uart controller on the zynq processor for a different zynq fpga. I believe this information should be applicable here as well.

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

@birca123

I was waiting with with you for a valid link to the possible solution to you problem(s).

First, let's see if I understand what it is that you are doing.

You want to transfer a image form your FPGA to a PC. The image consists of 640x480 binary bytes or approximately 307200 8-bit unsigned chars. You selected a non-standard data rate of 256000 baud with no flow control. To send one image would take (3017200/256000)*10/8 = 1.5 seconds if your FPGA and the PC can keep up.

One suggestion would be to add flow control. This could either be in the form of hardware RTS/CTS or embedding XON/XOFF control characters. If you are sending binary data then 7-bit control characters would seem to be an unworkable option. Given the long time to send an image I'm assuming that there is no minimum data rate to make your project work.

I typically use 921600 baud, without flow control, using an interpreted Python application and haven't had issues. What I don't typically do is try and send very large blocks of data at a time; or use a ZYNQ PS UART. You can do the math to see what adding fifo buffers, either on your FPGA or in your OS, will do to overcome expected down time in either your ZYNQ or PC application. It's not too hard to create a PC application that doesn't have enough time slots to keep up with even a pedestrian 256000 data rate. You wouldn't an application running on an OS to run without interruption for 1.5 seconds would you?

What I would suggest is that you make figuring out where things are going wrong by making this a side debugging project. You are,after all, using a great platform ( the ZYBO ) for instrumenting your designs' short-term and long term performance.

 

Edited by zygot

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron, @zygot,

Thank you Jon, for the link.

@zygot yeah, you are right, I'm not using flow control.
Actually, I'm sending a binary image in a way that 8 pixels are sent per data package, so 8 times less bytes are sent. Maybe the problem is in processing the data on the PC side after a byte is being received.  I will try to solve it with receiving all data first and after that processing all received data. If it won't work I'll implement the flow control, also my goal is to use 921600 buad without issues.

Best regards,

Toni

 

Share this post


Link to post
Share on other sites
  • 0

Good morning,

My similar problem was solved replacing USB-RS232 dongle with the one supporting high speed, specifically, Silicon Labs part number CP2102N-EK.

It should be mentioned that Zynq PS side was utilized for RS-232 at 921600 bit/s without flow control and parity. It worked flawlessly since for tw-way communication and sending large files. 

Hope it'll help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now