Zynq Petalinux: Unterschied zwischen den Versionen
Nick (Diskussion | Beiträge) |
Nick (Diskussion | Beiträge) |
||
| Zeile 90: | Zeile 90: | ||
*TFTP-Server [https://wiki.xnick.de/index.php/Python_-_PyPXE_Server Python - PyPXE Server] | *TFTP-Server [https://wiki.xnick.de/index.php/Python_-_PyPXE_Server Python - PyPXE Server] | ||
*TFTP-Server Windows | *TFTP-Server Windows | ||
boot.scr für TFTP-Server | |||
echo | |||
echo ********************* | |||
echo Load and program FPGA | |||
echo ********************* | |||
setenv loadbit_addr_r 0x1000000 | |||
tftpboot ${loadbit_addr_r} 1_tut_block_wrapper.bit | |||
fpga loadb 0 ${loadbit_addr_r} ${filesize} | |||
echo | |||
echo **************** | |||
echo Load Linux files | |||
echo **************** | |||
setenv fdt_addr_r 0x1f00000 | |||
setenv kernel_addr_r 0x2000000 | |||
setenv ramdisk_addr_r 0x3100000 | |||
tftpboot ${fdt_addr_r} 3_devicetree.dtb | |||
tftpboot ${kernel_addr_r} 4_uImage.bin | |||
tftpboot ${ramdisk_addr_r} 5_rootfs.cpio.uboot | |||
echo | |||
echo ************** | |||
echo Starting Linux | |||
echo ************** | |||
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} | |||
== Probleme == | == Probleme == | ||
Version vom 3. September 2021, 06:08 Uhr
Verwendetes Board Trenz TE0720.
Installation Petalinux
Download Petalinux 2020.2:
http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
Installation erfolgt im Verzeichnis /opt
Besitzer des Ordners /opt/ anpassen:
sudo chown <owner>:<owner> /opt/
Installation benötigter Tools
sudo dpkg-reconfigure dash
- "No" auswählen
sudo apt-get update sudo apt-get install tofrodos iproute2 gawk make net-tools libncurses5-dev tftpd zlib1g:i386 libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential screen pax gzip python2.7 -y
Installation Petalinux (Note: do not start from shared folder, copy installer into home directory)
mkdir -p /opt/petalinux/2020.2 sudo chmod +x petalinux-v2020.2-final-installer.run ./petalinux-v2020.2-final-installer.run -d /opt/petalinux/2020.2
source enviroment
source /opt/petalinux/2020.2/settings.sh
Webtalk deaktivieren:
petalinux-util --webtalk off
Erstellen eines Projektes mit Vivado
Erstelle des Projekte:
mkdir zynq_project/petalinux/ cd zynq_project/petalinux/ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
- <CPU_TYPE>: zynqMP, zynq, microblaze
- <PROJECT_NAME>: The name of the project you are building
Export/Import Hardware Konfiguration (wenn noch nicht geschehen):
Vivado ⇒ File ⇒ Export Hardware... ⇒ Petalinux <PROJECT_NAME> folder (zynq_project/petalinux/<PROJECT_NAME>)
Hardware Konfiguration von Vivado übernhemen:
petalinux-config --get-hw-description
Konfiguration PetaLinux (Optional):
petalinux-config petalinux-config -c u-boot petalinux-config -c kernel petalinux-config -c rootfs
Build spezieller Komponente:
petalinux-build -c u-boot #kernel, rootfs
Build komplette System:
petalinux-build
Erhaltene Dateien unter /opt/petalinux/2020.2/images/linux:
u-boot.elf image.ub
Konfigurationsdateien (petalinux):
- u-boot
zynq_project/petalinux/<PROJECT_NAME>/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/u-boot-xlnx/v2020.01-xilinx-v2020.2+git999-r0/u-boot-xlnx-v2020.01-xilinx-v2020.2+git999/.config
JTAG boot
- Mit XSCT Konsole
- Mit petalinux
petalinux-boot --jtag --u-boot # Upload von fsbl, devicetree, u-boot
petalinux-boot --jtag --kernel # Upload von fsbl.elf, system.dtb (devicetree),
u-boot.elf, uImage, rootfs.cpio.gz.u-boot, boot.scr
SD-Card boot
- Vorbereiten der SD-Karte für Boot
BOOT.bin
Erstellen BOOT.bin (fpga, fsbl, u-boot):
petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf --fpga images/linux/design_minimal_wrapper.bit
Auf SD-Karte kopieren.
Linux
Nötige Daten zum booten von Linux mit der SD:
images/linux/BOOT.bin #fpga, fsbl, u-boot images/linux/boot.src #boot script
Variante 1: (Flattened Image Tree)
images/linux/image.ub #device tree, kernel und rootfs
Variante 2:
images/linux/system.dtb #device tree images/linux/uImage #kernel images/linux/rootfs.cpio.gz.u-boot #rootfs
Auf SD-Karte kopieren.
TFTP-Boot
Für TFTP-boot muss der fsbl und u-boot geladen werden, entweder über SD-Karte, Flash oder JTAG. Das u-boot lädt dann die Dateien vom TFTP-Server.
Im TFTP-Server Verzeichniss müssen folgende Dateien liegen:
image.ub #device tree, kernel und rootfs
oder
system.dtb #device tree uImage #kernel rootfs.cpio.gz.u-boot #rootfs
TFTP-Server starten danach den Zynq mit Ethernet starten.
- TFTP-Server Python - PyPXE Server
- TFTP-Server Windows
boot.scr für TFTP-Server
echo
echo *********************
echo Load and program FPGA
echo *********************
setenv loadbit_addr_r 0x1000000
tftpboot ${loadbit_addr_r} 1_tut_block_wrapper.bit
fpga loadb 0 ${loadbit_addr_r} ${filesize}
echo
echo ****************
echo Load Linux files
echo ****************
setenv fdt_addr_r 0x1f00000
setenv kernel_addr_r 0x2000000
setenv ramdisk_addr_r 0x3100000
tftpboot ${fdt_addr_r} 3_devicetree.dtb
tftpboot ${kernel_addr_r} 4_uImage.bin
tftpboot ${ramdisk_addr_r} 5_rootfs.cpio.uboot
echo
echo **************
echo Starting Linux
echo **************
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
Probleme
| Fehler | Lösung |
|---|---|
|
Upload fsbl.elf und u-boot.elf |
Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0) |