Zynq Petalinux: Unterschied zwischen den Versionen

Aus Nicki Wiki
Zur Navigation springen Zur Suche springen
 
(55 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 23: Zeile 23:


== Erstellen eines Projektes mit Vivado ==
== Erstellen eines Projektes mit Vivado ==
Erstelle des Projekte
Erstelle des Projekte:
  mkdir zynq_project/petalinux/
  mkdir zynq_project/petalinux/
  cd zynq_project/petalinux/
  cd zynq_project/petalinux/
Zeile 30: Zeile 30:
* <PROJECT_NAME>: The name of the project you are building
* <PROJECT_NAME>: The name of the project you are building


Export/Import Hardware Konfiguration (wenn noch nicht geschehen)
Export/Import Hardware Konfiguration (wenn noch nicht geschehen):
  Vivado &rArr; File &rArr; Export Hardware... &rArr; Petalinux <PROJECT_NAME> folder (zynq_project/petalinux/<PROJECT_NAME>)
  Vivado &rArr; File &rArr; Export Hardware... &rArr; Petalinux <PROJECT_NAME> folder (zynq_project/petalinux/<PROJECT_NAME>)


Hardware Konfiguration von Vivado übernhemen
Hardware Konfiguration von Vivado übernhemen:
  petalinux-config --get-hw-description
  petalinux-config --get-hw-description
Wichtige Einstellungen:
Subsystem AUTO Hardware Settings  ---> Serial Settings  ---> FSBL Serial stdin/stdout (ps7_uart_0)  --->
Subsystem AUTO Hardware Settings  ---> Serial Settings  ---> DTG Serial stdin/stdout (ps7_uart_0)  --->
Subsystem AUTO Hardware Settings  ---> Ethernet Settings  ---> Ethernet MAC address
FSBL Configuration  --->  (FSBL_DEBUG_INFO) FSBL compiler flags


Konfiguration PetaLinux (Optional):
Konfiguration PetaLinux (Optional):
Zeile 41: Zeile 47:
  petalinux-config -c kernel
  petalinux-config -c kernel
  petalinux-config -c rootfs
  petalinux-config -c rootfs
Build spezieller Komponente
 
  petalinux-build -c u-boot    #kernel, rootfs
Einstellungen rootfs:
Build komplette System
Filesystem Packages ---> libs ---> boost ---> [*] boost
  Filesystem Packages ---> misc ---> tcf-agent ---> [*] tcf-agent
 
Build System:
  petalinux-build
  petalinux-build
petalinux-build -c u-boot    #Build spezieller Komponente (kernel, rootfs)
Erhaltene Dateien unter /opt/petalinux/2020.2/images/linux:
Erhaltene Dateien unter /opt/petalinux/2020.2/images/linux:
  u-boot.elf
  u-boot.elf
  image.ub
  image.ub


== JTAG boot ==
Konfigurationsdateien (petalinux):<br>
* Mit [https://wiki.xnick.de/index.php/XSCT_Konsole XSCT Konsole]
*'''u-boot'''
* Mit petalinux
  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
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 [https://wiki.xnick.de/index.php/Zynq_-_SD-Card SD-Card 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:
BOOT.bin
boot.src
'''Variante 1''' [https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842374/U-Boot+Images]:
image.ub    #Enthält Device Tree, Kernel und Rootfs
'''Variante 2''':
system.dtb            #device tree
uImage                #kernel
rootfs.cpio.gz.u-boot  #rootfs


== Probleme ==
* [https://wiki.xnick.de/index.php/Zynq_-_Boot Zynq - Boot]
{| class="wikitable"
!Fehler
!Lösung
|-
|
Upload fsbl.elf und u-boot.elf<br>
Keine oder nur fsbl.elf Ausgabe über die serielle Konsole.
|
Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0)
|}


== Quellen ==
== Quellen ==
*[https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetaLinux2020.2 Petalinux wiki trenz]
*[https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetaLinux2020.2 Petalinux wiki trenz]
*[https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1157-petalinux-tools-command-line-guide.pdf Petalinux commands]
*[https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug1157-petalinux-tools-command-line-guide.pdf Petalinux commands]

Aktuelle Version vom 8. Oktober 2021, 12:19 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

Wichtige Einstellungen:

Subsystem AUTO Hardware Settings  ---> Serial Settings  ---> FSBL Serial stdin/stdout (ps7_uart_0)  ---> 
Subsystem AUTO Hardware Settings  ---> Serial Settings  ---> DTG Serial stdin/stdout (ps7_uart_0)  ---> 
Subsystem AUTO Hardware Settings  ---> Ethernet Settings  ---> Ethernet MAC address
FSBL Configuration  --->   (FSBL_DEBUG_INFO) FSBL compiler flags 

Konfiguration PetaLinux (Optional):

petalinux-config
petalinux-config -c u-boot
petalinux-config -c kernel
petalinux-config -c rootfs

Einstellungen rootfs:

Filesystem Packages ---> libs ---> boost ---> [*] boost
Filesystem Packages ---> misc ---> tcf-agent ---> [*] tcf-agent

Build System:

petalinux-build
petalinux-build -c u-boot    #Build spezieller Komponente (kernel, rootfs)

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

Quellen