Working with Pre-built Designs
Overview
PetaLinux includes pre-built images for the supported reference designs to allow user to quickly bootup FS-Boot, U-Boot and the Linux kernel on the supported boards. The objective of this facility is to allow user to quickly evaluate the functionality provided by PetaLinux.
This document only cover the areas of development that is specific to using the PetaLinux pre-built designs, other supplementary documents maybe required. For more specific coverage of PetaLinux, refer to the PetaLinux User Guide.
Installation
Install the PetaLinux environment as per the PetaLinux Installation Guide.
Run PetaLinux Setup Script
Before using PetaLinux, it is required to run the settings.sh or settings.csh script to set up the appropriate environment variables. This sets up the path and the PETALINUX variable, so the build system and the boot script knows where everything is located.
$ cd petalinux $ source ./settings.sh
Note use the appropriate script for your shell environment.
Setting Up Evaluation Board
Xilinx ML401
This section outline the procedures for setting up the ML401 development board.
External Connectors
Connect the serial cable, RJ45 network cable, JTAG/Parallel cable and power cable to the ML401 board as per the ML401 User Guide.
Dip Switch Selector
Set the Selector switch SW12 to "SYSACE".
CFG Addr and Mode Dip Switch
Set the Configuration Address and Mode dip switch to JTAG mode. Set the dip switch as per the following table.
| Switch No | Value |
| SW1 | 0 |
| SW2 | 0 |
| SW3 | 0 |
| SW4 | 1 |
| SW5 | 0 |
| SW6 | 1 |
Xilinx Spartan3E500-RevC
This section outline the procedures for setting up the Spartan3E500-RevC development board.
External Connectors
Connect the serial cable, RJ45 network cable, JTAG/USB cable and power cable to the Spartan3E500-RevC board as per the Spartan3E500-RevC User Guide.
Jumper Settings
Ensure that the jumper settings J30 is set to M.S mode.
Xilinx Spartan3E1600-RevA
This section outline the procedures for setting up the Spartan3E1600-RevA development board.
External Connectors
Connect the serial cable, RJ45 network cable, JTAG/USB cable and power cable to the Spartan3E1600-RevA board as per the Spartan3E1600-RevA User Guide. The serial cable should be connected to J10 - the "DTE" serial port.
Jumper Settings
Ensure that the jumper settings J30 is set to M.S mode.
Working with pre-built Image
The pre-built reference design directory can be found in the following location.
$PETALINUX/hardware/reference-designs/pre-built/
Each reference design platform will have it's own directory containing all the pre-built images and operational scripts.
The following table describes the files and directory structure of the pre-built platform directory.
| File | Descriptions |
| etc | This directory contain scripts used for loading and configuring the platform with the pre-built images. |
| images | This directory contain the software images |
| implementation | This directory contains the hardware configuration bitstream |
Booting of the pre-built Design
PetaLinux includes a pre-built image boot script "petalinux-boot-prebuilt" that allows the user to selectively boot the different software components of the pre-built reference designs. These includes:
- FS-Boot First Stage Bootloader
- U-Boot Full Featured Bootloader
- Linux Kernel
Detailed description of the petalinux-boot-prebuilt script can be found in the PetaLinux Tools Chapter of the User Guide or by printing the usage information of the petalinux-boot-prebuilt script. E.g. $ petalinux-boot-prebuilt -?.
This section describes the steps to boot up each of the components of the pre-built design.
Ensure that the target evaluation board is setup as per the "Setting up Evaluation Board" Section and power up the board.
$PETALINUX environment variable
Ensure that the $PETALINUX environment variable is set for the terminal as per the "Run PetaLinux Setup script" section.
This will allow the petalinux-boot-prebuilt script to be executed to boot up the pre-built design from any location no your computer.
Connecting Serial Console
Connect the serial console such as Kermit to the target device at 115200 baud, 8-bit, 1 stop bit, no parity and no flow control. This step will allow you to see the boot messages.
Booting Linux Kernel
Execute the following command to boot the Linux kernel.
$ petalinux-boot-prebuilt -p Xilinx-ML401 -k 2.6
The above example attempts to boot the Linux 2.6 kernel on the Xilinx ML401 design. Substitude the Xilinx-ML401 string with the platform that you are using. For booting 2.4 kernel substitude the "2.6" string with "2.4".
Supported platform name and kernel version can be found by printing the usage information of the petalinux-boot-prebuilt script.
The Linux kernel boot messages should appear on the serial console window.
Booting U-Boot Bootloader
Execute the following command to boot the U-Boot bootloader.
$ petalinux-boot-prebuilt -p Xilinx-ML401 -l 2
The above example attempts to boot the U-Boot bootloader on the Xilinx ML401 design. Substitude the Xilinx-ML401 with the platform that you are using.
Supported platform name can be found by printing the usage information of the petalinux-boot-prebuilt script.
The U-Boot boot messages should appear on the serial console window.
Booting FS-Boot Bootloader
Execute the following command to boot the FS-Boot bootloader.
$ petalinux-boot-prebuilt -p Xilinx-ML401 -l 1
The above example attempts to boot the FS-Boot bootloader on the Xilinx ML401 design. Substitude the Xilinx-ML401 with the platform that you are using.
Supported platform name can be found by printing the usage information of the petalinux-boot-prebuilt script.
The FS-Boot boot messages should appear on the serial console window.
Automated Board Bring-up
PetaLinux also includes an Automated board bring-up demo, this demo will fully automate the entire board bringup process of the reference design without needing manul intervention.
This section provides details on how to run this process.
WARNING: Note that the steps provided in this section will erase the on-board external FLASH memory on the target board. Do not continue if you do not want your FLASH device to be erased. Also note that if the existing Flash device on the target board contains a valid U-Boot environment sector and the MAC address is set, the automatic board bring-up process will fail. This normally occurs when the automated board bring-up process was run more than once without erasing the U-Boot environment. Please erase the U-Boot environment settings on the Flash before proceeding.
Boot using petalinux-boot-prebuilt
Before executing the automated board bring-up command, ensure that all existing serial console session is closed.
Execute the following command to start the automated board bring-up process.
$ petalinux-boot-prebuilt -p Xilinx-ML401 -k 2.6 -l 4
The above example attempts to run the board bringup process on the Xilinx ML401 design for the 2.6 kernel. Substitude the Xilinx-ML401 with the platform that you are using.
Output messages similar to the following should appear on the termial window.
LEVEL 4 BOOT: Configuring the FPGA... FPGA configuration completed. Downloading and booting U-Boot from RAM memory, this may take a few minutes. Done.. ...
This step will automatically download the necessary images onto the target and configure the device to automatically boot up when the device is power-on or reset.
The configuration process will start a new "kermit" connection to the device on the existing console and all messages will be printed onto the console. The user can monitor the different stage of the board bringup process if required.
This process will take a while to complete. Approximately, 15 minutes depending on the device. However, no interventation is required during this process.
Once the board bring-up is completed the user can login to the Linux kernel via the login prompt on the kermit console window.
To exit the kermit session press "Ctl\q".
Now the device will automatically boot up when the hardware configuration bitsteams is downloaded into the FPGA.
