Zynq - Boot: Unterschied zwischen den Versionen
Nick (Diskussion | Beiträge) |
Nick (Diskussion | Beiträge) |
||
| Zeile 120: | Zeile 120: | ||
default "PXEClient:U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R | default "PXEClient:U-Boot.armv7" if CPU_V7A || CPU_V7M || CPU_V7R | ||
Nach der Änderung muss das u-boot neu gebaut werden!<br> | Nach der Änderung muss das u-boot neu gebaut werden!<br> | ||
INFO petalinux: Existieren keine configs | 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! |