Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programmable-logic:zybo-z7:demos:petalinux [2022/09/02 11:50] – [Using the demo] Radu-Augustin Vele | programmable-logic:zybo-z7:demos:petalinux [2023/08/25 00:29] (current) – Move to direct file links for downloads Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Zybo Z7 Petalinux Demo ====== | ||
+ | {{: | ||
+ | ===== Description ===== | ||
+ | |||
+ | The Zybo Z7 Petalinux demo demonstrates the usage of various board features from within a Linux environment. | ||
+ | |||
+ | Available features: | ||
+ | * Ethernet with Unique MAC address and DHCP support | ||
+ | * USB Host support | ||
+ | * UIO drivers for onboard switches, buttons and LEDs | ||
+ | * SSH server | ||
+ | * Build essentials package group for on-board compilation using gcc, etc. | ||
+ | * HDMI output with KMS (kernel mode setting) | ||
+ | * HDMI input via UIO drivers | ||
+ | * Pcam 5C input via V4L2 drivers (only for Zybo Z7-20) | ||
+ | |||
+ | ---- | ||
+ | ===== Inventory ===== | ||
+ | |||
+ | * Zybo Z7 (-10 or -20) with a MicroUSB Programming Cable. | ||
+ | * Petalinux Installation compatible with the latest release of this demo | ||
+ | * //See Xilinx' | ||
+ | * Serial Terminal application to receive messages printed by the demo | ||
+ | * //See [[programmable-logic: | ||
+ | * Micro SD card formatted as a FAT filesystem | ||
+ | |||
+ | |||
+ | **For the Pcam 5C demo**: | ||
+ | * Pcam 5C to use video for Linux functionality | ||
+ | * Ethernet cable to retrieve the pictures as .bin files (useful for testing the Ethernet feature as well) | ||
+ | * External 5V power supply | ||
+ | |||
+ | **For testing the HDMI and USB features**: | ||
+ | * 1 HDMI Type A to Type A or HDMI Type A to DVI-D cable | ||
+ | * HDMI or DVI monitor | ||
+ | * Keyboard with USB 2.0 cable | ||
+ | |||
+ | **For changing or extending the hardware platform**: | ||
+ | * Vivado installation compatible with the latest release of this demo | ||
+ | * //See [[programmable-logic: | ||
+ | |||
+ | ---- | ||
+ | ===== Download and Usage Instructions ===== | ||
+ | |||
+ | First and foremost, releases - consisting of a set of files for download - are only compatible with a specific version of the Xilinx tools, as specified in the name of the release (referred to as a //release tag//). In addition, releases are only compatible with the specified variant of the board. For example, a release tagged " | ||
+ | |||
+ | The latest release version for this demo is highlighted in green. | ||
+ | |||
+ | **Note:** //Releases for FPGA demos from before 2020.1 used a different git structure, and used a different release tag naming scheme.// | ||
+ | |||
+ | ^ Board Variant | ||
+ | | Zybo Z7-10 | @#C0EEBD: 10/ | ||
+ | | Zybo-Z7-20 | ||
+ | | Zybo Z7-10 | 10/ | ||
+ | | Zybo Z7-20 | 20/ | ||
+ | | Zybo Z7-10 | 10/ | ||
+ | | Zybo Z7-20 | 20/ | ||
+ | | Zybo Z7-20 | v2017.4-3 | ||
+ | | Zybo Z7-10 | v2017.4-1 | ||
+ | | Zybo Z7-20 | v2017.2-1 | ||
+ | | Zybo Z7-10 | v2017.2-1 | ||
+ | |||
+ | **Note for Advanced Users:** //GitHub sources for this demo can be found in the [[https:// | ||
+ | ---- | ||
+ | Instructions on the use of the latest release can be found in this dropdown: | ||
+ | |||
+ | --> Using the Latest Release #^ | ||
+ | |||
+ | <WRAP group> | ||
+ | |||
+ | {{page> | ||
+ | |||
+ | --> (Alternative for building the project) Use the pre-built image # | ||
+ | |||
+ | **Note**: This procedure only works if you are using the .bsp release. If you cloned the project source directly from GitHub, skip this section. | ||
+ | |||
+ | If the project created from the .bsp release contains the // | ||
+ | |||
+ | ---- | ||
+ | <-- | ||
+ | |||
+ | --> Set up the Zybo Z7-20 # | ||
+ | |||
+ | **Set up for booting Petalinux on the Board**: | ||
+ | |||
+ | * Plug the Zybo Z7-20 into the computer via the microUSB programming cable and power on the board (you can also use an external power supply, but make sure the JP6 is set properly). Make sure the JP5 jumper is set to SD. Use the steps described in //Booting Petalinux on a Zynq Board//. | ||
+ | |||
+ | ** Additional set up for the Pcam 5C demo: ** | ||
+ | |||
+ | * Make sure you are powering the Zybo Z7-20 with an external 5V power supply and have the JP6 jumper on the **WALL** option. | ||
+ | * For retrieving the pictures you can use multiple procedures described in the //Using the demo// section. | ||
+ | * Attach the Pcam 5C assembly (which includes the Pcam 5C and the attached 15-pin flat flexible cable) by inserting the other end of the FFC into the Pcam connector on the Zybo Z7 as shown in image below. Ensure the cable is securely latched by pressing down firmly on the connector with two fingers. For a more detailed set of instructions, | ||
+ | |||
+ | {{: | ||
+ | ---- | ||
+ | <-- | ||
+ | |||
+ | {{page> | ||
+ | |||
+ | At this point, the demo is now running on your board. Refer to the [[# | ||
+ | </ | ||
+ | <-- | ||
+ | |||
+ | ---- | ||
+ | A brief set of instructions to some of the configurations which can be done in Petalinux can be found in this dropdown: | ||
+ | |||
+ | --> Petalinux Configurations # | ||
+ | <WRAP group> | ||
+ | |||
+ | {{page> | ||
+ | |||
+ | </ | ||
+ | <-- | ||
+ | ---- | ||
+ | ===== Using the demo ===== | ||
+ | |||
+ | The functionality of the demo features are presented in the sections below. | ||
+ | |||
+ | --> Testing the Ethernet connection # | ||
+ | <WRAP group> | ||
+ | |||
+ | After you connect the Ethernet cable to the network (wall outlet, router, PC) run the following command in the serial terminal. You can choose as address your PC's Ethernet or Wi-Fi IP address (depending on how your PC is connected to the network). | ||
+ | |||
+ | < | ||
+ | ping < | ||
+ | </ | ||
+ | |||
+ | Upon success you should see no packet loss. | ||
+ | |||
+ | Alternatively you can run the command: | ||
+ | |||
+ | < | ||
+ | ip a | ||
+ | </ | ||
+ | |||
+ | If there is a successful connection, you should be able to read the board' | ||
+ | |||
+ | < | ||
+ | 2: eth0: (...) | ||
+ | (...) | ||
+ | inet <ip address> | ||
+ | (...) | ||
+ | </ | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Testing the USB support # | ||
+ | <WRAP group> | ||
+ | For testing USB support you can insert a FAT-formatted USB stick into the board' | ||
+ | If the device is detected you should see in the terminal a message similar to: | ||
+ | < | ||
+ | usb-storage 1-1:1.0: USB Mass Storage device detected | ||
+ | </ | ||
+ | |||
+ | Next, run the command | ||
+ | < | ||
+ | fdisk -l | ||
+ | </ | ||
+ | |||
+ | This way you can identify the device location, e.g. /dev/sda1. If that location is different in your case, you should use it instead of /dev/sda1 next. | ||
+ | |||
+ | To mount the USB drive you should run the following commands | ||
+ | < | ||
+ | mkdir / | ||
+ | mount /dev/sda1 / | ||
+ | </ | ||
+ | You could use that directory to transfer data between the board and your PC. | ||
+ | |||
+ | Before removing the USB stick from the board you can unmount it using the command | ||
+ | < | ||
+ | umount / | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Testing the LEDs, switches and buttons using UIO drivers # | ||
+ | <WRAP group> | ||
+ | </ | ||
+ | |||
+ | The boards LEDs, switches and buttons can be accessed through UIO drivers. In some of the earlier versions of the project (before 2020) a series of [[https:// | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Testing the SSH server# | ||
+ | <WRAP group> | ||
+ | |||
+ | One way to test the SSH server is to connect to the board from your PC via SSH. | ||
+ | |||
+ | First, get your board' | ||
+ | < | ||
+ | ssh root@< | ||
+ | </ | ||
+ | |||
+ | You should be able to interact with the linux environment similarly to the serial terminal. | ||
+ | |||
+ | </ | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Testing the packages # | ||
+ | <WRAP group> | ||
+ | |||
+ | To view all installed packages run the command | ||
+ | < | ||
+ | ls /usr/bin | ||
+ | </ | ||
+ | |||
+ | For testing for instance your gcc package you can try to create and compile a C source file. | ||
+ | Create a source file: | ||
+ | < | ||
+ | cd ~ | ||
+ | touch source_file.c | ||
+ | </ | ||
+ | Open it using the vi editor: | ||
+ | < | ||
+ | vi source_file.c | ||
+ | </ | ||
+ | Insert a simple C program code. Press **i** and copy-paste the following code using **Ctrl+Insert** - **Shift+Insert**: | ||
+ | < | ||
+ | #include < | ||
+ | |||
+ | int main() { | ||
+ | printf(" | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | Save it by pressing **Esc** and typing **:wq** | ||
+ | |||
+ | Compile and run it | ||
+ | < | ||
+ | gcc source_file.c -o my_app | ||
+ | ./my_app | ||
+ | </ | ||
+ | |||
+ | Upon success you should see the output: Hello World | ||
+ | |||
+ | </ | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Testing the HDMI output and USB input from keyboard # | ||
+ | <WRAP group> | ||
+ | </ | ||
+ | |||
+ | To test the HDMI output with kernel mode setting, connect a HDMI cable between your HDMI TX port and an HDMI monitor. Next, connect your keyboard to the USB port. | ||
+ | |||
+ | You should be able to use the monitor the same way as the serial terminal, type in commands using the connected keyboard and access all features in the demo. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | **Note**: For the HDMI input there is currently no demo application that uses the UIO drivers. | ||
+ | |||
+ | <-- | ||
+ | |||
+ | --> Taking pictures using V4L2 and the Pcam 5C (Z7-20 only) # | ||
+ | <WRAP group> | ||
+ | |||
+ | Run the following commands in the serial console connected to your board. | ||
+ | |||
+ | **Set the width, height, and frame rate of your capture.** | ||
+ | < | ||
+ | width=1920 && height=1080 && rate=15 | ||
+ | </ | ||
+ | |||
+ | Before running the next commands make sure to use arguments that correspond to the data in the device topology. | ||
+ | To view the information about the video device run the command: | ||
+ | < | ||
+ | media-ctl /dev/media0 -p | ||
+ | </ | ||
+ | |||
+ | You should be able to view the device topology with various entities and pads. Pay attention to the **ov5640 2-003c** and **43c60000.mipi_csi2_rx_subsystem** entities whose names could slightly change. If any of the names differ from the ones used in the commands below make sure to modify them to include the correct name. | ||
+ | |||
+ | **Prepare your media and video pipeline.** | ||
+ | < | ||
+ | media-ctl -d /dev/media0 -V '" | ||
+ | media-ctl -d /dev/media0 -V '" | ||
+ | v4l2-ctl -d /dev/video0 --set-fmt-video=width=" | ||
+ | </ | ||
+ | |||
+ | **Capture 14 frames.** | ||
+ | < | ||
+ | yavta -c14 -f YUYV -s " | ||
+ | </ | ||
+ | |||
+ | As a result you should obtain 14 .bin files | ||
+ | |||
+ | <WRAP round important> | ||
+ | ==Warning== | ||
+ | The camera module takes some time to automatically adjust the exposure and white balance. While this is happening, the frames will come out dark and with green tints. Capture more frames than needed for your usecase. | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <-- | ||
+ | |||
+ | --> Retrieving the pictures # | ||
+ | <WRAP group> | ||
+ | |||
+ | To retrieve the pictures you need to transfer the .bin files on your Linux machine. Next they are processed and converted to .png using the //ffmpeg// tool. There are multiple ways to move the pictures from the board to the PC: through scp (make sure to have the board and PC connected to the same network), through the SD card (by copying the binary files to / | ||
+ | |||
+ | Make sure no data was lost during the transfer of the files. | ||
+ | |||
+ | Run the following commands in a terminal on your Linux machine to copy the files via SSH. | ||
+ | |||
+ | Replace 10.113.0.117 with your board' | ||
+ | < | ||
+ | scp [email protected]: | ||
+ | </ | ||
+ | |||
+ | <WRAP round tip> | ||
+ | You can also find the IP address of your board by running the following command in your serial console. | ||
+ | < | ||
+ | ip addr show | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Set the width, height, and framerate of your capture. | ||
+ | < | ||
+ | width=1920 && height=1080 && rate=15 | ||
+ | </ | ||
+ | |||
+ | Using ffmpeg, convert the files you copied into PNG. | ||
+ | < | ||
+ | for f in *.bin; do mv " | ||
+ | for f in *.yuv; do ffmpeg -s " | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | <-- | ||
+ | |||
+ | --> (Non-functional) Audio input / output # | ||
+ | <WRAP group> | ||
+ | <WRAP round important> | ||
+ | ==Warning== | ||
+ | Audio features are currently completely non-functional. | ||
+ | </ | ||
+ | |||
+ | Run the following commands in the serial console connected to your board. | ||
+ | |||
+ | Start a pulseaudio server. | ||
+ | < | ||
+ | pulseaudio --start | ||
+ | </ | ||
+ | |||
+ | <WRAP round tip> | ||
+ | If you see a message similar to the following one, you need to start the pulseaudio server again. | ||
+ | < | ||
+ | ALSA lib ../ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | See the [[https:// | ||
+ | |||
+ | </ | ||
+ | <-- | ||
+ | |||
+ | ---- | ||
+ | ===== Additional Resources ===== | ||
+ | |||
+ | All materials related to the use of the Zybo Z7 can be found on its [[..: | ||
+ | |||
+ | All materials related to the use of the Pcam 5C can be found on its [[add-ons: | ||
+ | |||
+ | For additional and in-depth information about how Petalinux works please consult the [[https:// | ||
+ | |||
+ | For technical support, please visit the [[https:// | ||
+ | |||
+ | ---- | ||
+ | {{tag> |