Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
Tutorial
Missing Image!
Part 6 - Build pre-existing application into PetaLinux

Introduction

This tutorial details the steps required to enable and install the pre-existing peek & poke applications and check they are working as expected.

Aims

The aims of this tutorial are as follows :-

    Part 1 - Project Setup

    1. Setup environment
    2. Change present working directory

    Part 2 - Enable existing application

    1. Enable peek/poke application

    Part 3 - Build & package PetaLinux

    1. Build PetaLinux
    2. Package PetaLinux

    Part 4 - Hardware Deployment

    1. Setup Zedboard hardware
    2. Launch MiniCom terminal emulator
    3. Run PetaLinux on Zedboard via JTAG
    4. Check everything is working as expected

    Part 6 - Revision Control

    1. Commit to repository

    Part 5 - Quickstart

    1. Obtain tutorial files from Bitbucket, create & build project, deploy on Zedboard
    #### Part 1 - Project Setup ####

    1. Setup environment

    Setup Xilinx design environment for the 2021.2 toolset.
    steve@Desktop:~$ xilinx
    Xilinx tools available tools at /opt/Xilinx :-
    1) 2021.2 - Vivado - SDK - Vitis - PetaLinux
    0) Exit
    Please select tools required or exit : 1

    Tools are as follows :-
    vivado @ /opt/Xilinx/Vivado/2021.2/bin/vivado
    vitis @ /opt/Xilinx/Vitis/2021.2/bin/vitis
    petalinux-build @ /opt/Xilinx/PetaLinux/2021.2/tool/tools/common/petalinux/bin/petalinux-build

    2. Change present working directory

    Change the present working directory to be the project directory.
    steve@Desktop:~$ cd ~/projects/zedboard_linux/os/petalinux
    #### Part 2 - Enable existing application ####

    3. Enable peek/poke application

    The Peek/Poke application is enabled through the configuration tool. Launch the tool to begin.
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ zedboard_linux-config -c rootfs
    The configuration tools should now present the root menu. Missing Image! Tip: Use the up & down arrow keys to nagivate the heirarchy, the left & right arrow keys to navigate the bottom menu, the enter key to select heirarchy/menu items, and the y & n keys to enable/disable components.

    Navigate to apps and select it to enter the apps menu. Missing Image! Enable the peekpoke application. Missing Image! Exit the apps menu. Missing Image! Exit the configuration tool by exiting the root menu. Missing Image! Save the configuration on exit. Missing Image!
    #### Part 3 - Build & package PetaLinux ####

    4. Build PetaLinux

    Rebuild the project to include the updated files.
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ petalinux-build

    5. Package PetaLinux

    Package up the project ready for deployment.
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ petalinux-package --prebuilt --force
    #### Part 4 - Hardware Deployment ####

    6. Setup Zedboard hardware

    Connect up the hardware as follows :-
    1. Xubuntu PC USB ⇄ Zedboard USB JTAG/Debug
    2. Xubuntu PC USB ⇄ Zedboard USB UART
    3. Zedboard Ethernet ⇄ Router
    4. Xubuntu PC Ethenet ⇄ Router
    5. Router ⇄ Internet
    Missing Image! Set the boot mode jumpers on the Zedboard for JTAG. Missing Image! Power on the Zedboard.

    7. Launch MiniCom terminal emulator

    If not already running, open up a new terminal and launch the MiniCom terminal emulator.
    steve@Desktop:~$ minized

    Welcome to minicom 2.7.1

    OPTIONS: I18n
    Compiled on Dec 23 2019, 02:06:26.
    Port /dev/ttyACM0, 06:34:25

    Press CTRL-A Z for help on special keys

    8. Run PetaLinux on Zedboard via JTAG

    Power cycle the Zedboard and deploy the project via JTAG.
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ zedboard_linux-boot --jtag --prebuilt 3

    9. Check everything is working as expected

    When the PetaLinux login prompt appears login using the root credentials.

    Check the peek & poke applications have installed correctly by launching them.
    root@petalinux:~# peek
    usage: peek ADDR

    ADDR may be specified as hex values
    root@petalinux:~# poke
    usage: poke ADDR VAL

    ADDR and VAL may be specified as hex values
    Check the peek application works by setting the outer two slides switches to their on position and reading the slide switch register.
    root@petalinux:~# peek 0x41200008
    0x00000081
    Check the poke application works by writing to the LED register, illuminating the outer four LED's and then the inner four.
    root@petalinux:~# poke 0x41200000 0xC3
    root@petalinux:~# poke 0x41200000 0x3C
    #### Part 6 - Revision Control ####

    10. Commit to repository

    Commit the updated files, create an annotated tag and push the commit & tag up to the remote repository.
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ git commit -am "Enabled Peek/Poke application."
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ git tag -a v2.0 -m "PetaLinux & Peek/Poke with XSA from zedboard_leds_switches v1.0"
    steve@Desktop:~/projects/zedboard_linux/os/petalinux$ git push
    #### Part 5 - Quickstart ####

    11. Obtain tutorial files from Bitbucket, create & build project, deploy on Zedboard

    The source files relating to this tutorial for the OS can be obtained from Bitbucket. The OS repository contains both PetaLinux and a local copy of the exported hardware (firmware).

    The instructions below assume that Part 1 - Installation of tools, setup of environment and creation of project area has been completed in full and that the environment has been setup as per 1. Setup environment. The root project area ~/projects should be present and contain the common project. The zedboard_linux projects should NOT be present. Adjust the commands below to suit if the above differs.

    Obtain OS source, build & deploy on Zedboard.
    steve@Desktop:~$ cd ~/projects
    steve@Desktop:~/projects$ git clone -b v2.0 https://bitbucket.org/spacewire_firmware/zedboard_linux
    steve@Desktop:~/projects$ cd zedboard_linux/os/petalinux
    Do something with the OS (if required) then perform the following steps :-
    1. Build PetaLinux
    2. Package PetaLinux
    3. Setup Zedboard hardware
    4. Launch MiniCom terminal emulator
    5. Run PetaLinux on Zedboard via JTAG
    6. Check everything is working as expected