Board Setup
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.
Xilinx 擁有一個文檔網站,詳細說明如何正確設置 PYNQ-Z2 開發板。為了簡化,我將僅介紹必要的程序,以便我們能夠使 YOLO 應用程序運行。欲了解更多詳情,您可以參考文檔。
Preparation
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;
將啟動跳線設置為 SD 位置。這將使主板從微型 SD 卡加載操作系統;Set the Power jumper to REG, so the board will receive power from the power regulator and not the USB cable;
將電源跳線設置為 REG,這樣主板將從電源調節器接收電源,而不是從 USB 線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.
插入帶有自定義映像的 Micro SD 卡(我們用 DPU 刷寫的那個)。請記得按照圖片所示從後面插入。Connect the micro USB cable between your Host computer and the board.
將微型 USB 線纜連接在您的主機電腦和電路板之間。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;
將以太網纜線(RJ45)連接筆記型電腦和主板。如果您的電腦沒有 RJ45 端口,請不要忘記使用適配器;Connect the power adapter's coaxial port on the PYNQ-Z2 to give it the necessary power;
將電源適配器的同軸端口連接到 PYNQ-Z2,以提供所需的電源;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.
打開 PYNQ-Z2,啟動序列應該對應於紅色 LED 立即亮起,表示主板已通電。然後,名為 Done 的黃色/綠色 LED 將亮起,顯示 Zynq 服務已準備就緒。
USB connection
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.
可以使用 USB 連接到主板來供電或控制主板。要在 PYNQ-Z2 和主機電腦之間建立 USB 連接,我們可以使用像 Putty 這樣的應用程式。您可以按照以下描述在官方網站上下載它。
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.
在啟動 Putty 之前,我們必須查看哪個端口對應於 PYNQ-Z2。這可以通過進入設備管理器和 COM 及 LPT 端口來實現。當你打開 PYNQ-Z2 時,應該會出現一個新的端口,描述類似於 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:
然後我們可以通過在搜索欄中輸入它的名稱來啟動 Putty。首先,我們需要將通信設置為串行,然後根據您在設備管理器中看到的端口寫入 COM 端口。接下來,在速度域中輸入 115200,這是數據傳輸的波特率。這些步驟在下面的圖片中描述:
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:
在此之後,將出現一個終端,並顯示有關 PYNQ-Z2 自訂映像的啟動序列的許多資訊。完成後,系統將要求您登錄。以下是登錄資訊:
Login: root
Password: root
Now let's give the board a IP address so we can establish a SSH communication:
現在讓我們為主板分配一個 IP 地址,以便我們可以建立 SSH 通信:
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.
在官方的 PYNQ-Z2 SD 卡映像中,板子的預設 IP 位址為 192.268.2.99,因此我們為了簡便設置了相同的位址。如果您將 PYNQ-Z2 直接連接到家中的網路交換機,則 IP 位址將是對應於設備上端口的位址。
Network connection
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.
現在我們想通過 SSH 將板子連接到主機電腦。這是通過通常稱為以太網纜線的 RJ45 纜線來完成的。如果您的電腦上沒有端口,請記得使用 RJ45 轉 USB 適配器。作為替代,您可以將板子連接到家中的交換機,但我無法確認它是否與我們的自定義 SD 卡映像兼容。
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:
PYNQ-Z2 已經有一個 IP 地址,因此我們需要為主機電腦分配一個靜態地址,讓兩者在同一範圍內連接。為此,您首先需要進入控制面板,然後選擇網路和網際網路,接著進入網路和共享中心菜單。現在您要選擇以太網連接,而不是您可能擁有的無線連接。這可以在下一張圖片中看到:
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.
現在我們需要將電腦的網路卡設置為與我們給予 PYNQ-Z2 的 IP 在同一範圍內。以下圖片描述了執行此操作的步驟。請記住,您可以在 192.168.2.1 和 192.168.2.98 之間分配 IP 以使其正常運作。配置完成後,您必須點擊「確定」以保存配置。之後,您的電腦與開發板之間將建立 SSH 連接。
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:
為了確認網路連接,我們可以使用 PING 協議向板子的 IP 地址發送封包。如果連接可用,PYNQ-Z2 必須確認接收到封包。您可以通過在 Windows 的命令行 (CMD) 中輸入 "ping 192.168.2.99" 來確認這一點。成功的通信應該會產生如下輸出:
X-11 connection
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.
現在與主板之間有了安全的網絡連接,我們可以使用計算機對其進行全面控制。然而,終端界面對於缺乏經驗的用戶來說可能有些混淆且不直觀,因此我們將實施圖形界面網絡協議(GUI - 圖形用戶界面)。這個協議被稱為 X11 或 X 窗口系統,它允許在基於 UNIX 操作系統的遠程服務器上開發和管理圖形應用程序,並使用主機計算機。換句話說,X11 將允許 PYNQ-Z2 操作系統的圖形界面,並使創建窗口和界面變得更加容易。
The next image demonstrates how you can execute a X11 connection with the PYNQ-Z2 board.
下一張圖片展示了如何使用 PYNQ-Z2 板執行 X11 連接。
After this you will have to login on the MobaXterm Terminal. Remember that the username is "root" and the password is "root".
在這之後,您需要在 MobaXterm 終端上登錄。請記住,使用者名稱是 "root",密碼是 "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.
登錄後,首先要做的是啟用 DNNDK 函式庫,以便後續 API 與 DPU 之間的互動成為可能。您可以按照下一張圖片中所描述的方式進行。
Now everything is set to execute the YOLO on the PYNQ-Z2 board. It's almost there!
現在一切都已準備好在 PYNQ-Z2 板上執行 YOLO。快到了!
Last updated