• 0
NotMyCupOfTea

Creating an UART interface on Zybo Z7010

Question

Posted (edited)

Dear All,

I have currently finished a PL program for signal processing and hardware controlling on the Zybo Z7010 board. Now, I want to ensure that some parameters can be easily modified by the user on a computer. Thus, I would like to use the USB -- micro-USB cable to instaure a communication between the user and the board.

After some reading, I understand that I have to use the PS if I want to go through the micro-USB UART port (I have not yet used the PS in my project...).

Hence, I need two things:

     - Instantiating the UART interface and writing the C/C++ script to ensure communication between User and PS

     - Creating a write/read connection between PS and PL to modify the parameters after reception by the PS.

How should I proceed? As usual, feel free to ask for any further information.

P.S. : Until now, I have used only Verilog and VHDL code to make the whole project run and am very uncomfortable with the "Block design" tool, so please be as specific as possible if block design is required (or faster/simpler...)

Thank you very much,

Edited by NotMyCupOfTea

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 1

Bare metal is a stand alone program that runs on the PS without an operating system and is developed and deployed though Xilinx SDK.

With Linux, you run Linux on the board and write a regular Linux application using the Linux toolchain.

I suggest you read up a bit on both and see which you prefer.

Share this post


Link to post
Share on other sites
  • 1

Hi @NotMyCupOfTea,

The usb uart bridge is tied to the PS in the Zybo-Z7-10. You will be using the zynq processor to send/receive data through the usb uart bridge. The Zybo-Z7-10-DMA, and Zybo-Z7-10-HDMI are bare-metal projects for the Zybo-Z7-10 that use the USB UART bridge. 

Initially, I would suggest starting with a more basic vivado project using the hello world template in sdk.

Here are the basic steps to getting this project working in Vivado:

1. Makes sure the board files are installed and you select the zybo-z7-10 when creating the project.

2. create a block design

3. add the zynq processor and run the default(board files) block automation.

4. connect the axi-m-gp0-aclk pin to the fclk_clk0  pin on the zynq processor.

5. right click on the design in the sources tab and create a wrapper letting vivado handle it.

6. generate a bitstream.

7. Export the hardware including the bitstream.

8. Launch SDK

in sdk:

1. once sdk has fully loaded with the hw_platform them click on file and add a new application. 

2. give it a name and leave everything else as default. select next.

3. Select the hello world template.

4. program the FPGA

5. Open a serial terminal emulator like tera term and connect the com port of the Zybo-Z7-10. Make sure to adjust the baud rate to 115200 and typically leave all of the other settings at default.

6. right click on the application and select run as->launch on hardware(system debugger)

and you should see hello world on the serial terminal!!!!

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

It's not clear whether you want to use Linux or bare metal.

You didn't mention Linux, but you posted in the Linux area.

If you're interested in bare metal, we'll move the discussion one level up to the FPGA area so it gets the proper visibility.

Share this post


Link to post
Share on other sites
  • 0

Hi @vicentiu,

I don't really know the difference between "Linux" and "Bare metal" and am sorry if I have posted the question in the wrond repository...

As I don't know the difference, I can't tell yet which of these options I'd prefer...

Feel free however to move the discussion where it is most appropriate (or if I have to do it please let me know).

Thank you,

Share this post


Link to post
Share on other sites
  • 0

Dear All,

Thank you for your clear answers.

@vicentiu : I think I understood the difference between bare metal and linux enbedded in the PS and as I don't need to do very complex operations in the PS I think bare metal will be enough for this time. (Though, I might change my mind in the future...)

@jpeyron : Thank you so much for your detailed guidelines! I will follow those steps during the week-end but I won't be able to test it before Monday as I don't have the board with me. Starting with this simple project seems a good idea, now I have a question about step 4 for the project I described above. If I am not mistaken, the axi-m-gp0-aclk is the port used to connect PS and PL, how will I have to connect it in the future?

Thank you very much and have a nice week-end,

NotMyCupOfTea

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Dear All,

I have been working today and unfortunately did not manage to work out your instructions @jpeyron. Here are a few thoughts:

- When I want to use the "Hello World" template, it says that I have no UART in my design and that I can't use it. I therefore went back to the design ==> customize IP and add UART1 port in the "MIO Configuration". This seems to solve the matter...

- When I manage it through to point 6, running the application give me the following error : AP transaction error DAP status f0000021. My guess lies in a comment line of the Hello World that specifies that ps7 (==> Zynq PS) is not initialized by this particular example...

 

Nevertheless, I have been looking around for another project meanwhile and I can successfully run the "Echo example project" you presented in this thread. There is just one little problem which is that when pressing the "ESC" key, it should print "Successfully..." and it prints "uccesfully...". I have checked the baud rate...

Now, I will try to reproduce the architecture to apply it to a simple project (see attached files). I want to turn on one of the four leds of the board according to the parameter called "LED", giving the user the possibility to change this parameter from the serial terminal.

I have tried turning the parameter into a reg input and packaging the project into an IP and replacing the GPIO module with it but when I package it only the "clk" appears as input of the module. I have looked around but am currently I little lost on how to proceed...

Thank you for your patience and any tips you can give me,

NotMyCupOfTea,

blinky.zip

Edited by NotMyCupOfTea

Share this post


Link to post
Share on other sites
  • 0

Hi @NotMyCupOfTea,

Looking at the blinky project as well as what you describe with the uart project they are not using the Digilent Board files.

This tutorial here shows how to install the Digilent Board files.  The Zynq processor's default settings when selecting the Zybo-Z7-10  and running the block automation correctly configures the Zynq processor. It also has most of the components selected initially like the uart. You should be able to run the hello world without changing anything in the zynq processor. 

With the blinky project are you tying to add the verilog module to the zynq processor? If so you should be using the ADD a Module function like in your other thread here

 

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Dear @jpeyron,

Thank you for your answer. I already had the Digilent Board files installed but it looks like they are used correctly only if you select the board (and not the part) in the "Creat a Project" wizard...

When I did that, everything worked as I wanted, the Hello World project as well.

Concerning the "Blinky" project, I don't quite understand... is it enough to have the blinky.v file in the same project directory? I couldn't manage to package it as an IP...

By the way, I have been following this tutorial until exercise 5 (where I am stuck because I don't know how bitmasks work...). I will try to do exercise 6 to read and write from memory from PS but I will have to do the same on PL.

Thank you for your patience,

NotMyCupOfTea

Edited by NotMyCupOfTea

Share this post


Link to post
Share on other sites
  • 0

Dear @jpeyron,

Thank you very much for your answer! I am now one step closer to achieving what I'm up to.

I have managed to create my custom IP block which has one parameter (which led to switch on) and one output (the 4-bit signal connected to the leds).

Now, I have set the parameter to 2 while building the project and the correct led is turned on. Is there a way to modify this parameter from an SDK application?

Thank you,

NotMyCupOfTea,

Share this post


Link to post
Share on other sites
  • 0

Dear @jpeyron,

Your help has been once again decisive to the success of the project I'm working on.

Thank you !

For those who are interested, please find here the files for the blinky project I was able to build. From this point, it is only a matter of minutes to adapt it to your own customized project.

Best regards to all,

NotMyCupOfTea

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