How to use an additionnal UART in a Pynq-based system running on Zedboard
This tutorial shows how to add an additional UART module on a PYNQ-based system only by modifying the programmable logic (PL) part of a Zynq system. The tutorial was applied on a Zedboard platform running Pynq 2.4 image.
Introduction
First of all, you need to have a working PYNQ-based system. This tutorial can be applied on any PYNQ-based system. For instance, on a Pynq-Z1 platform the base overlay
Overlay building
- Start Vivado tool. I used
Vivado 2017.4but any other version can be used to generate the bitstream of the overlay. - Create an RTL project.
- In a block design, instantiate
Zynq PS system. RunAutomation toolto build the basic Zynq-based system. - From the IP catalog, add
UART AXI litemodule. Run againAutomation toolto connect the instantiated axi-based uart to the PS. - By default, the baud rate is 9600. Right click on the module and adapt the values to your project. In my case, I chose the baud rate of 115200, no parity, ho hardware control.
- Add a constraint file
constraints.xdcwith the pin assignments forRXandTX. On Zedboard, I choseJB PMODport for UART connections:JB1connected toW11andJB2connected toW12. - Create an HDL-wrapper of your design.
- Run synthesize, implementation and generate bistream phases. Wait until the bitsream is generated.
- Export the block design you create by
File->Export->Export Block Design - Rename the generated
design_1.tclanddesign_1_wrapper_hdl.bittouart.bitanduart.tcl
UART IP using in PYNQ
- Connect to your Zedboard through Samba and copy
uart.bitanduart.tclto the pynq overlay folder - Connect to your platform via browser via
192.168.7.2 - Download the uart custom overlay to the Zedboard PL part
- By ussing
mmiopackage and the memory addresses we can access to theRXandTXdata.