Jump to content
  • 0

Creating an UART interface on Zybo Z7010


NotMyCupOfTea

Question

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,

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

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

Link to comment
Share on other sites

Dear @Anji and @hawk20002000,

Sorry for the absence of response...

I am sorry that you couldn't find the project any more... however I'm no longer able to upload it as my internship is finished and I don't have access to it any more.

However, I can provide a very detailed guide that explains how to build the blinky project.

Concerning @Anji's problem, I don't think this might help though as you already are able to communicate back and forth with the FPGA. However, I have seen that it is indeed possible to upload files in the board memory to read them. Maybe someone else here might be able to help you more.

Have a nice day,

Using Vivado 2018 to define user inputs.docx

Link to comment
Share on other sites

Hi @NotMyCupOfTea,

I am working on a similar kind of task (transferring a text file containing binary value) to FPGA and receiving its o/p in text file. I am using a digilent Zedboard  and I want to make a UART interface in FPGA. So far,  i have succeed sent hardcoded i/p value in the algorithm and I can see output via SDK terminal or using teraterm. I have to test bunch of matrices so I want to make input dynamic and i thought if I can sent a text file via UART to FPGA. I am a newbie and I am stuck here. I tried looking to your completed file so that I could get some idea but I am not able to see it ( error message: "owner moves file in trash "). Can you give access to those file please. 

Thanks you,

Anji

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...