element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Zedboard printing garbage/junk over UART
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • +1 person also asked this people also asked this
  • Replies 22 replies
  • Answers 1 answer
  • Subscribers 78 subscribers
  • Views 1031 views
  • Users 0 members are here
  • zedboard
  • uart
Related

Zedboard printing garbage/junk over UART

crank1
crank1 1 month ago

Hello, I have been working through some basic examples on the Zedboard, i.e. creating a simple PL fabric to switch an LED upon a button press. The board will program fine, and the system will work (i.e. LEDs and buttons work fine), however, whenever it prints something to the terminal, it appears as junk. I have a cable plugged into the J17 (prog) port and the J14 (UART) port. I have tried every baud rate possible, I understand that the standard is 115200, however no baud rate works (have tried on Vitis Terminal, PuTTy and TeraTerm). I have installed the Cypress (now distributed by Infinion) USB to UART drivers and the board comes up on the device manager as a serial device. I have also tried plugging the J14 port into my Macbook and using screen, but it still has the same issue. All the boot jumpers (JP7-JP11) are grounded. I am using Windows 10 and Vivado and Vitis 2022.2. Are there any other reasons as to why it would be printing junk? I have played around with the Linux install on the SD and all works fine when using a serial terminal, so I don't think it is a driver problem. Thanks.

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett 1 month ago +2
    Connect a scope to the serial port. Ideally one which can decode UART protocols. This will enable you to actually measure the baud rate and comprehend the data. Could be parity/baud rate/ handshake/number…
  • Gough Lui
    Gough Lui 1 month ago +2
    Perhaps the system is expecting a clock crystal source of a certain frequency and the actual crystal you are using is a different frequency, resulting in everything being "at the wrong speed". Check…
  • saadtiwana_int
    saadtiwana_int 1 month ago +1
    I think what Gough Lui mentioned could very well be the issue, because you are getting serial output, just not at the right baud rate probably. And since with the Linux image it's working fine, so it can…
  • michaelkellett
    0 michaelkellett 1 month ago

    Connect a scope to the serial port. Ideally one which can decode UART protocols. This will enable you to actually measure the baud rate and comprehend the data. Could be parity/baud rate/ handshake/number of data bits type issue, scoping will reveal which (if any).

    MK

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui 1 month ago

    Perhaps the system is expecting a clock crystal source of a certain frequency and the actual crystal you are using is a different frequency, resulting in everything being "at the wrong speed".

    Check that you're building things with the right target selected and clocks (source and speed) configured. Unfortunately, I have no experience with Zedboard or the latest Xilinx toolchains to give you any more guidance, but that would be what I would think of if all common baud rates are not working.

    - Gough

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • saadtiwana_int
    0 saadtiwana_int 1 month ago

    I think what Gough Lui  mentioned could very well be the issue, because you are getting serial output, just not at the right baud rate probably. And since with the Linux image it's working fine, so it can't be a hardware issue outside of the FPGA. 

    - Did you start by selecting the Zedboard as your platform when creating the vivado project? Doing like this will apply the correct board presets, including specifying correct clock frequencies

    - Are you using a PS connected uart, or are you instantiating a uartlite in the FPGA fabric?

    If you share your vivado block diagram, it should be a good start.

    -Saad

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crank1
    0 crank1 1 month ago in reply to saadtiwana_int

    Thanks for the response, I did select the Zedboard as the hardware platform when creating the Vivado project. And yes, I am using the PS connected to UART - the PL does not interact with the UART.

    image

    The block diagram is posted above. Here are the clock frequencies used as well:

    image

    This is the simple program running on the PS:

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • saadtiwana_int
    0 saadtiwana_int 1 month ago in reply to crank1

    Ok, thanks for sharing.

    Do you also have the correct UART selected in the Zynq block design and correct pins specified? Something like this:

    image

    image

    - Saad

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crank1
    0 crank1 1 month ago in reply to saadtiwana_int

    image

    Yes, everything looks the same - UART 1 originally had the Pullups disabled, so I tried enabling them, and it still did not work.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • saadtiwana_int
    0 saadtiwana_int 1 month ago in reply to crank1

    Some more things to try:

    1. Can you replace the print() with xil_printf() 

    2. Inside Vitis SDK, under your board support package settings, can you verify that the stdin and stdout point to the correct UARTs?

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crank1
    0 crank1 1 month ago in reply to saadtiwana_int

    Done - nothing changed.  The other things I can think of are conflicting board revisions? I have a Zedboard revision F and the board file used for the Vivado project is revision D (there is no board file for the more recent revisions). 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • saadtiwana_int
    0 saadtiwana_int 1 month ago in reply to crank1

    You can try to find the change history to see if anything related was changed. But I doubt such a major change was made between revisions. But good to rule it out anyway.

    Do you have a logic analyser or oscilloscope to see what what's actually being output on the UART lines? It might help to find the root cause.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • crank1
    0 crank1 1 month ago in reply to saadtiwana_int

    I had a quick look, and there does not seem to be any changes of relevance between revisions. Unfortunately I do not have access to any kind of analytical device at the moment. I will continue to tweak settings to see if I can get any sort of output (I just manually changed the UART baud rate to 9600 and it was still outputting junk). Thanks for all the help and the quick responses :)    

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube