Zynq - Boot: Unterschied zwischen den Versionen
Nick (Diskussion | Beiträge) |
Nick (Diskussion | Beiträge) |
||
| (33 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 12: | Zeile 12: | ||
Erstellen BOOT.bin (fpga, fsbl, u-boot): | 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 | 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. | petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf #tftp-boot | ||
Auf SD-Karte kopieren.<br> | |||
'''Info:''' Welcher fsbl von Vitis (fsbl.elf) oder von petalinux (zynq_fsbl.elf) genommen wird ist egal. Es funktioniert auch das u-boot vom Xilinx-Repository (u-boot-xlnx). | |||
=== Linux === | === Linux === | ||
| Zeile 28: | Zeile 30: | ||
== TFTP-Boot== | == TFTP-Boot== | ||
Für TFTP-boot muss der Zynq erst '''fsbl''' und '''u-boot''' laden, entweder über SD-Karte, Flash oder JTAG. Das u-boot lädt die Dateien übers Netzwerk vom TFTP-Server.<br> | Für TFTP-boot muss der Zynq erst '''fsbl''' und '''u-boot''' laden, entweder über SD-Karte, Flash oder JTAG. Das u-boot lädt die Dateien übers Netzwerk vom TFTP-Server.<br> | ||
Download | petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf #tftp-boot | ||
Download Tools: | |||
sudo apt install -y u-boot-tools | sudo apt install -y u-boot-tools | ||
Das U-Boot Bootskript <code>boot.scr</code> enthält die Downloadanleitung für das '''u-boot'''. | Das U-Boot Bootskript <code>boot.scr</code> enthält die Downloadanleitung für das '''u-boot'''. | ||
===Variante 1 ([https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842374/U-Boot+Images Flattened Image Tree])=== | ===Variante 1 ([https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842374/U-Boot+Images Flattened Image Tree])=== | ||
Bootskript: | Bootskript: <code>boot.scr</code> | ||
echo | echo | ||
echo ********************* | echo ********************* | ||
| Zeile 39: | Zeile 42: | ||
echo ********************* | echo ********************* | ||
setenv loadbit_addr_r 0x1000000 | setenv loadbit_addr_r 0x1000000 | ||
tftpboot ${loadbit_addr_r} 1_design_minimal_wrapper.bit | tftpboot ${loadbit_addr_r} '''1_design_minimal_wrapper.bit''' | ||
fpga loadb 0 ${loadbit_addr_r} ${filesize} | fpga loadb 0 ${loadbit_addr_r} ${filesize} | ||
echo | echo | ||
| Zeile 46: | Zeile 49: | ||
echo **************** | echo **************** | ||
setenv image_addr_r 0x10000000 | setenv image_addr_r 0x10000000 | ||
tftpboot ${image_addr_r} image.ub | tftpboot ${image_addr_r} '''image.ub''' | ||
echo | echo | ||
echo ************** | echo ************** | ||
| Zeile 53: | Zeile 56: | ||
bootm ${image_addr_r} | bootm ${image_addr_r} | ||
Mit <code>mkimage</code> das <code>boot.scr.uimg</code> erzeugen: | Mit <code>mkimage</code> das TFTP-Downloadscript <code>boot.scr.uimg</code> erzeugen: | ||
mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg | mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg | ||
Neben dem <code>boot.scr.uimg</code> | |||
Neben dem <code>boot.scr.uimg</code> muss zusätzlich folgende Datei im TFTP-Server Verzeichniss liegen: | |||
image.ub #device tree, kernel und rootfs | |||
=== Variante 2 === | === Variante 2 === | ||
Bootskript: | Bootskript: <code>boot.scr</code> | ||
echo | echo | ||
echo ********************* | echo ********************* | ||
| Zeile 67: | Zeile 69: | ||
echo ********************* | echo ********************* | ||
setenv loadbit_addr_r 0x1000000 | setenv loadbit_addr_r 0x1000000 | ||
tftpboot ${loadbit_addr_r} 1_design_minimal_wrapper.bit | tftpboot ${loadbit_addr_r} '''1_design_minimal_wrapper.bit''' | ||
fpga loadb 0 ${loadbit_addr_r} ${filesize} | fpga loadb 0 ${loadbit_addr_r} ${filesize} | ||
echo | echo | ||
| Zeile 76: | Zeile 78: | ||
setenv kernel_addr_r 0x2000000 | setenv kernel_addr_r 0x2000000 | ||
setenv ramdisk_addr_r 0x3100000 | setenv ramdisk_addr_r 0x3100000 | ||
tftpboot ${fdt_addr_r} 3_devicetree.dtb | tftpboot ${fdt_addr_r} '''3_devicetree.dtb''' | ||
tftpboot ${kernel_addr_r} 4_uImage | tftpboot ${kernel_addr_r} '''4_uImage''' | ||
tftpboot ${ramdisk_addr_r} 5_rootfs.cpio.gz.u-boot | tftpboot ${ramdisk_addr_r} '''5_rootfs.cpio.gz.u-boot''' | ||
echo | echo | ||
echo ************** | echo ************** | ||
| Zeile 85: | Zeile 87: | ||
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} | bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} | ||
Mit <code>mkimage</code> das <code>boot.scr.uimg</code> erzeugen: | Mit <code>mkimage</code> das TFTP-Downloadscript <code>boot.scr.uimg</code> erzeugen: | ||
mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg | mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg | ||
Neben dem <code>boot.scr.uimg</code> | Neben dem <code>boot.scr.uimg</code> müssen zusätzlich folgende Dateien im TFTP-Server Verzeichniss liegen: | ||
3_devicetree.dtb #device tree | |||
4_uImage #kernel | |||
5_rootfs.cpio.gz.u-boot #rootfs | |||
=== TFTP-Server === | === TFTP-Server === | ||
| Zeile 106: | Zeile 110: | ||
| | | | ||
Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0) | Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0) | ||
|- | |||
|DHCP: Es wird keine oder erst sehr spät eine IP-Adresse vergeben (non-pxe client) | |||
| | |||
Suche: <code>grep -r 'U-Boot.armv7' PFAD</code> <br> | |||
petalinux PFAD: <code>pfad_zu/petalinux/<PROJECT-NAME>/</code> <br> | |||
xilinx PFAD: <code>pfad_zu/u-boot-xlnx/</code> <br> | |||
default "U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R | |||
ändern zu: | |||
default "PXEClient:U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R | |||
Nach der Änderung muss das u-boot neu gebaut werden!<br> | |||
INFO petalinux: Existieren keine configs ⇒ <code>petalinux-config -c u-boot</code> ⇒ Exit | |||
|} | |} | ||
Aktuelle Version vom 11. Oktober 2021, 04:54 Uhr
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 petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf #tftp-boot
Auf SD-Karte kopieren.
Info: Welcher fsbl von Vitis (fsbl.elf) oder von petalinux (zynq_fsbl.elf) genommen wird ist egal. Es funktioniert auch das u-boot vom Xilinx-Repository (u-boot-xlnx).
Linux
Nötige Daten zum booten von Linux mit der SD-Karte:
images/linux/BOOT.bin #fpga, fsbl, u-boot images/linux/boot.src #boot script
Zusätzlich Variante 1 oder Variante 2 auf SD-Karte kopieren.
- 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
TFTP-Boot
Für TFTP-boot muss der Zynq erst fsbl und u-boot laden, entweder über SD-Karte, Flash oder JTAG. Das u-boot lädt die Dateien übers Netzwerk vom TFTP-Server.
petalinux-package --boot --fsbl images/linux/fsbl.elf --u-boot images/linux/u-boot.elf #tftp-boot
Download Tools:
sudo apt install -y u-boot-tools
Das U-Boot Bootskript boot.scr enthält die Downloadanleitung für das u-boot.
Variante 1 (Flattened Image Tree)
Bootskript: boot.scr
echo
echo *********************
echo Load and program FPGA
echo *********************
setenv loadbit_addr_r 0x1000000
tftpboot ${loadbit_addr_r} 1_design_minimal_wrapper.bit
fpga loadb 0 ${loadbit_addr_r} ${filesize}
echo
echo ****************
echo Load Linux files
echo ****************
setenv image_addr_r 0x10000000
tftpboot ${image_addr_r} image.ub
echo
echo **************
echo Starting Linux
echo **************
bootm ${image_addr_r}
Mit mkimage das TFTP-Downloadscript boot.scr.uimg erzeugen:
mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg
Neben dem boot.scr.uimg muss zusätzlich folgende Datei im TFTP-Server Verzeichniss liegen:
image.ub #device tree, kernel und rootfs
Variante 2
Bootskript: boot.scr
echo
echo *********************
echo Load and program FPGA
echo *********************
setenv loadbit_addr_r 0x1000000
tftpboot ${loadbit_addr_r} 1_design_minimal_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
tftpboot ${ramdisk_addr_r} 5_rootfs.cpio.gz.u-boot
echo
echo **************
echo Starting Linux
echo **************
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
Mit mkimage das TFTP-Downloadscript boot.scr.uimg erzeugen:
mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.scr boot.scr.uimg
Neben dem boot.scr.uimg müssen zusätzlich folgende Dateien im TFTP-Server Verzeichniss liegen:
3_devicetree.dtb #device tree 4_uImage #kernel 5_rootfs.cpio.gz.u-boot #rootfs
TFTP-Server
TFTP-Server starten danach den Zynq mit Ethernet starten.
- TFTP-Server Python - PyPXE Server
- TFTP-Server Windows
Probleme
| Fehler | Lösung |
|---|---|
|
Upload fsbl.elf und u-boot.elf |
Die Ausgabe vom u-boot.elf erfolgt über UART 1 (nicht UART 0) |
| DHCP: Es wird keine oder erst sehr spät eine IP-Adresse vergeben (non-pxe client) |
Suche: default "U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R ändern zu: default "PXEClient:U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R Nach der Änderung muss das u-boot neu gebaut werden! |