Board Setup
Last updated
Last updated
Xilinx has a documentation site that explains in detail how to setup the PYNQ-Z2 board properly. For simplicity I will go through only the necessary procedures so we can make the YOLO application work. For more details you can consult the documentation.
As in the official tutorial, we are going to connect the desired cables to the board and set the jumpers correctly. Follow the numeric procedures as described on the image:
Set the Boot jumper to the SD position. This will make the board load the Operating System on the micro SD card;
Set the Power jumper to REG, so the board will receive power from the power regulator and not the USB cable;
Insert the Micro SD card with the custom image (the one we flashed with the DPU). Remember to insert it from the back as described on the image.
Connect the micro USB cable between your Host computer and the board.
Connect the Ethernet cable (RJ45) between the Laptop and the board. Don't forget to use the adapter if your computer doesn't have the RJ45 port;
Connect the power adapter's coaxial port on the PYNQ-Z2 to give it the necessary power;
Turn on the PYNQ-Z2 and the boot sequence should correspond to a red LED turning immediately on representing that the board has power. Then the Yellow/ Green LED called Done will turn on showing that the Zynq service is ready.
A USB link to the board can be used to supply power or to control the board. To establish a USB connection between the PYNQ-Z2 and the host computer we can use an application like Putty. You can download it on the official website as described below.
Before launching Putty, we have to see which port corresponds to the PYNQ-Z2. This is possible by going to the Device Manager and COM and LPT Ports. When you turn on the PYNQ-Z2 there should appear a new port there described as something similar to COM4.
Then we can launch Putty by typing on the search bar it's name. First we need to setup the communication to Serial, then write the COM port according to the one you saw at the Device Manager. Next, on the Speed domain you write 115200 which is the Baud Rate of the data transmission. This steps are described on the image bellow:
After this, a Terminal will appear and many information's regarding the Boot sequence of the PYNQ-Z2 custom image will be displayed. After that is complete, you will be asked to log in. These are the log in information's:
Login: root
Password: root
Now let's give the board a IP address so we can establish a SSH communication:
On official SD card images for the PYNQ-Z2 the default IP address of the board is 192.268.2.99 and so we established the same address for simplicity. If you were to connect the PYNQ-Z2 directly to the Internet switch on your home the IP address would be the one corresponding to the port on the device.
Now we want to connect the board to the host computer via SSH. This is done with the RJ45 cable commonly known as Ethernet cable. Remember to use the adapter RJ45 to USB if you don't have the port on your computer. In alternative, you could connect the board to your home switch but I can't confirm if it works with our custom SD card image.
The PYNQ-Z2 already has an IP address so now we need to assign a static address to the host computer on the same range so both are connected. To do this you first go to Control Panel and then Network and Internet and after that go to the Network and Sharing Center menu. Now you want to select the Ethernet connection and not the wireless connection you probably have. This can be seen on the next image:
Now we need to set the Network Card of the computer with an IP on the same range as the one we gave to the PYNQ-Z2. The following image describes the steps to do exactly that. Remember that you can assign an IP between 192.168.2.1 and 192.168.2.98 for this to work. After the configuration you have to click "OK" to save the configuration. After this there will be a SSH connection between your computer and the board.
The configurations are in Portuguese but you should be able to do it because the presentation is the same.
To confirm the Network Connection we can use the PING protocol to send packets to the board's IP address. If the connection is available, the PYNQ-Z2 must confirm the reception of the packets. You can confirm this opening the Command line on Windows (CMD) and writing "ping 192.168.2.99". A successful communication should result on a output like this:
Now that there is a safe network connection with the board, we can have total control over it using the computer. However, the Terminal interface can be a bit confusing and not intuitive for inexperienced users so we will implement a Graphical interface Network protocol (GUI - Graphical User Interface). This protocol is named X11 or X Window System and it allows the development and management of graphical applications on a remote server based on UNIX Operating System using the host computer. In other words, X11 will allow a graphical interface of the PYNQ-Z2 OS and will make it easier to create Windows and interfaces.
The next image demonstrates how you can execute a X11 connection with the PYNQ-Z2 board.
After this you will have to login on the MobaXterm Terminal. Remember that the username is "root" and the password is "root".
The first time you put the password it will say it is wrong. You have to write the password a second time and it will work now.
After the login, the first thing to do is to activate the DNNDK libraries so that later the interaction between the API and the DPU is possible. You can do it as described on the next image.
Now everything is set to execute the YOLO on the PYNQ-Z2 board. It's almost there!