Open main menu

DAVE Developer's Wiki β

Changes

DESK-XZ7-L/Deployment/Standalone boot

275 bytes added, 13:02, 21 November 2022
Program boot images into internal storage
==== Program the NOR flash ====
=====u-Boot=====
Update to the latest u-boot version allows usage of u-boot environment variables available. In the following example, the binary files are present in the SD card FAT32 first partition.
Update to the latest u<pre class="workstation-boot version allows usage of u-boot environment variables availableterminal">Zynq> fatload mmc 0:1 0x10000000 BOOT.BIN22149396 bytes read in 1840 ms (11.5 MiB/s)</pre>
then erase and program the <code>BOOT.BIN</code> binary image:
<pre class="workstation-terminal">
=Zynq> sf probe; sf erase 0 2000000SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiBSF: 33554432 bytes @ 0x0 Erased: OKZynq> sf write 0x10000000 0 ${filesize}device 0 offset 0x0, size 0x151f914SF: 22149396 bytes @ 0x0 Written: OKZynq> run load
</pre>
<div class="mw-collapsible mw-collapsed">
=====fit image =====
We assume that the following environment variables are present in u-boot:
 
<pre>
loadk=tftpboot ${loadaddr} ${serverip}:${bootfile}
</pre>
* Update the <code>bootfilefit image</code> and <code>fdtfile</code> environment variables to fit the filename as found inside the TFTP server.
* Program kernel and device tree on NOR flash with the following U-Boot command
=> saveenv
</pre>
 
</div>
==== Program root file system into NAND flash ====
* Boot the system via SD or NFS as described in the e [[(<KIT>)#Quick_start_guideDESK-XZ7-L/General/Booting_from_NFS|Quick start guideBooting from NFS]]guide
* By default, the NAND is already partitioned to allow booting from NAND-only (see next section) and, thus, some partitions are reserved for u-boot and kernel images. Here we won't modify this default configuration. The [[Memory Tecnology Device (MTD)|MTD]] partitions can be dumped with <code>/proc/mtd</code> (the partition's name should be self-explanatory)
<pre class="workstation-terminal">
{{ImportantMessage|text=Please note that MTD partition index may change depending of flash device availability, flash device size, u-boot environment variables or kernel device driver load order. Always take care of looking inside <code>/proc/mtd</code> to match your specific layout}}
* Format and initialize ''nand-ubi'' partition, which in our case is <code>mtd7mtd0</code>, using [[Memory Tecnology Device (MTD)#UBI|UBI]] with:
<pre>
ubiformat /dev/mtd0
* finally, you need to cleanly umount and detach the MTD partition
 
<pre>
umount /mnt/nand/
ubidetach -m 0
</pre>
 
E.g.
<pre class="workstation-terminal">
root@bora:~# umount /mnt/nand/
[ 2446.743091] UBIFS: un-mount UBI device 0, volume 0
[ 2446.749670] UBIFS: background thread "ubifs_bgt0_0" stops
root@bora:~# ubidetach -m
[ 2450.738153] UBI: detaching mtd7 from ubi0
[ 2450.759527] UBI: mtd7 is detached from ubi0
</pre>
8,286
edits