Getting Started with PYNQ on Red Pitaya STEMlab 125-14
Last updated
Last updated
Red Pitaya is a project that aims to provide an alternative to numerous expensive laboratory measuring and control instruments. It is classified as open-source, but the hardware design is proprietary. This board uses the Xilinx Zynq 7000 (XC7Z010-1CLG400C).
This board has its own Linux image that comes with web-based measurement applications, but in this case I don't do measurement, so I want to try to use the PYNQ image.
Red Pitaya STEMlab 125-14 is not officially supported by PYNQ. Thankfully, someone has already built the PYNQ image for this board. So, I just use the PYNQ image from this repository.
Win32DiskImager (https://win32diskimager.org/)
PuTTY (https://www.putty.org/)
Download the image file Pynq-Redpitaya-125-14-3.0.1.img from the repository.
Write the image file to the microSD card with the Win32DiskImager program.
Insert the microSD card into the board, connect the micro USB cable to the PC, and connect the power supply.
Open the PuTTY program and set up a serial connection. Select the appropriate COM port by looking at Device Manager (Windows).
Baud rate = 115200
Data bits = 8
Stop bits = 1
Flow control = None
Parity = None
The system is automatically logged in, but if you want to connect to the board from an SSH terminal, then we have to enter the username and password.
Username: xilinx
Password: xilinx
Important
If you want to turn off the board, you should shutdown it; don't immediately remove the power supply. This is done to avoid corrupted microSD, which can cause boot failure.
Run this command.
I use an Edimax EW-7811Un USB Wi-Fi dongle that uses the Realtek RTL8188CUS chipset. The driver for this Wi-Fi dongle is already installed.
We can use this command to display information about USB buses and the devices connected to them. We will see the USB Wi-Fi dongle detected.
Next, we can use this command to connect to a Wi-Fi access point.
Then, use this command to configure a static IP address.
Finally, we can reboot the board to see the changes.
Now, we can login to the Jupyter Notebook via web browser by entering the IP address of the board:
URL: 192.168.1.99:9090
Password: xilinx
We can also connect to a Wi-Fi access point that uses PEAP, which is commonly used in enterprise wireless and wired networks. This is the configuration for the wpa_supplicant.conf
.
This configuration is used to configure the board with a dynamic IP address.
For some reason, when I try to install a Python package using pip
, an error occurs, and I find that the error is related to the DNS configuration. So, I set the DNS permanently in the resolv.conf
file.
First, we install the resolvconf
package.
Then, we activate and run the resolvconf
service.
Next, we enter the nameserver IP address in the head resolvconf
configuration file.
After that, we run the resolv.conf
update.
If an error like this occurs, then run the following command.
Finally, we can verify by displaying the contents of the resolv.conf
file.
Now that we have configured the board, the next step is to try to create a basic hardware design. My hardware design consists of an AXI GPIO and an AXI DMA. The AXI GPIO is connected to 8 LEDs. The AXI DMA is connected to a looped-back AXIS FIFO.
The following figure shows the Zynq IP high-performance port configuration. The S AXI HP0 and S AXI HP2 interfaces are enabled.
The following figure shows the AXI DMA IP configuration.
The following figure shows the AXI GPIO IP configuration.
To upload files, such as bitstreams, from the laptop to the board, you can use FileZilla via the Ethernet connection.
Required programs:
FileZilla (https://filezilla-project.org/)
The connections required are:
Host: 192.168.1.99
Username: xilinx
Password: xilinx
Port: 22
To upload the hardware design to PYNQ, you need to upload three files: .bit
, .tcl
, and .hwh
.
The following notebook is used to test the hardware design. It consists of a Python program to test the AXI GPIO and the AXI DMA.
The results show that the AXI GPIO and AXI DMA can be accessed successfully.
Red Pitaya STEMlab 125-14, https://redpitaya.com/stemlab-125-14/
PYNQ for Redpitaya-125-14, https://github.com/dspsandbox/Pynq-Redpitaya-125
Connect to your WiFi using Linux command line, https://www.youtube.com/watch?v=c-9kRhvs3Mw
How to Set Permanent resolv.conf on Ubuntu, https://musaamin.web.id/set-permanent-resolv-conf-ubuntu/
Tutorial: PYNQ DMA (Part 1: Hardware design), https://discuss.pynq.io/t/tutorial-pynq-dma-part-1-hardware-design/3133
Tutorial: PYNQ DMA (Part 2: Using the DMA from PYNQ), https://discuss.pynq.io/t/tutorial-pynq-dma-part-2-using-the-dma-from-pynq/3134