Date: Fri, 29 Mar 2024 01:00:15 +0100 (CET) Message-ID: <1487521830.535.1711670415946@[172.25.0.138]> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_534_596134933.1711670415944" ------=_Part_534_596134933.1711670415944 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The phyBOARD-Zeta is delivered with a pre-flashed bootloader. Th= e following instructions for flashing images from SD card will be useful if= you want to:
Pre-built images are available on PHYTEC's Artifactory= . If you have built your own images, then the images are located i= n: $YOCTO_DIR/build/tmp/deploy/images/<MACHINE NAME>/<= /em>
Note that the names of the images differ between releases. YOCTO_IMAGE i= n the instructions below refers to the Yocto image name that was used to bu= ild the image, and YOCTO_MACHINE refers to the machine that was selected to= build the image. Refer to the "Built Images" section of the Quickstart per= taining to the specific release you are using for clarification on image na= mes.
The SD card image "<YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard" can= be flashed to eMMC. This image will need to be copied to the boot= partition of a properly formatted SD card as described in <= a href=3D"/display/PRODUCTINFO/i.MX7%3A+Creating+a+Bootable+SD+Card">Create= a Bootable SD Card.
Due to the UUIDs of the partitions in the sdcard image, it is recommende= d that you manually format the SD card if you plan on using it after flashi= ng the image to eMMC, otherwise if using the sdcard image for both eMMC and= SD, mmcblk0p1 and mmcblk1p1 as well as mmcblk0p2 and mmcblk1p2 will have t= he same UUID.
Due to the size of the image, a new partition is required on the SD = card to hold it. To create an additional partition that extends to the rest= of the SD card, execute the following from your host machine:
sudo fdisk /dev/= sd<X> =09=09p=09=09=09print partition table. *Note end of partition /dev/sd<x&= gt;2* =09 =09=09n =09=09=09new partition =09=09p =09=09=09primary =09=093 =09=09=09partition number =09=09<start> =09enter value after end of partition 2 (from partition= table). This is the first sector of partition 3 =09=09<enter>=09=09Use default value for last sector =09=09t=09=09=09Change partition system id =09=093=09=09=09Partition number =09=09c =09=09=09FAT32 =09=09w=09=09=09write table to disk and exit sudo mkfs.vfat -n "data" /dev/sd<X>3
Copy the sdcard image to the new "data" partition:
cp <YOCTO_IMA= GE>-<YOCTO MACHINE>.sdcard /media/user/data/; sync
Flash <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard from the= SD card to eMMC. This will partition the card and copy U-Boot, zImage, dtb= , and root filesystem to eMMC.
Umount existing partitions (if any) an= d write the image to flash.
umount /run/medi= a/mmcblk2p* dd if=3D/run/media/mmcblk0p3/<YOCTO_IMAGE>-<YOCTO MACHINE>.sdca= rd of=3D/dev/mmcblk2 bs=3D1MB; sync
The default <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard image is la= rger than the DDR3 so cannot be loaded into memory from U-Boot. Use Option = 1 for flashing eMMC.
Configure the boot switch to boot from SD Card as described in = i.MX7 Boot Co= nfigurations. Power on the board and stop in U-Boot.
Flash <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard from the= SD card to eMMC. This will partition the card and copy U-Boot, zImage, dtb= , and root filesystem to eMMC.
=3D> fatload = mmc 0:3 ${loadaddr} <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard reading <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard 935329792 bytes read in 41164 ms (21.7 MiB/s) =3D> mmc dev 1 switch to partitions #0, OK mmc1(part 0) is current device =3D> mmc write ${loadaddr} 0x0 <number of blocks to write. In this ca= se 0x1BF000> MMC write: dev # 1, block # 0, count 1830912 ... 1830912 blocks written: OK
Reset the board. Stop in U-Boot again and check that the partition t= able for eMMC is as expected.
=3D> reset ... =3D> mmc dev 1 switch to partitions #0, OK mmc1(part 0) is current device =3D> mmc part Partition Map for MMC device 1 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 8192 16384 ef3963c1-01 0c 2 24576 1794048 ef3963c1-02 83
Flash U-Boot to eMMC. The i.MX7 expects an Image Vector Table offset of = 0x400 bytes for SD/MMC boot device type. Type the following in U-Boot (alte= rnatively, use dd command in Linux):
fatload mmc 0:1 = ${loadaddr} u-boot.imx mmc dev 1 mmc write ${loadaddr} 0x2 <u-boot image size in blocks>
From Linux, copy the kernel and device tree file to eMMC:
# The eMMC parti= tions will mount to /run/media/ on boot. If you just partitioned eMMC, you = may manually mount the partition: mkdir /run/media/mmcblk2p1 mount /dev/mmcblk2p1 /run/media/mmcblk2p1 cp /run/media/mmcblk0p1/zImage /run/media/mmcblk2p1/; sync cp /run/media/mmcblk0p1/zImage-<YOCTO_MACHINE>.dtb /run/media/mmcblk2= p1/oftree; sync
From Linux, flash the root filesystem to eMMC, partition 2.
dd if=3D/run/med= ia/mmcblk0p3/<YOCTO_IMAGE>-<YOCTO MACHINE>.ext4 of=3D/dev/mmcbl= k2p2 bs=3D1M
The target can be booted from on-board media. In our standard configurat= ion, this BSP release loads the kernel and root filesystem from MMC if an S= D card is inserted in the micro SD card slot. If no SD card is present, it = will boot from eMMC.
This is the default boot configuration. Simply type the following:
boot
By default, the U-Boot environment is configured to autodetect which mmc= interface U-boot was booted from (See i.MX7: Boot Configurations) and boot the kern= el and root file system from the same device. However, if you would like to= boot Linux from eMMC regardless of the boot source for U-Boot, then disabl= e auto-detection and set the mmc boot device to mmc1 by modifying the envir= onment as follows:
=3D> setenv m= mcautodetect no =3D> setenv mmcdev 1 =3D> saveenv
Reset the board and let it boot fully into Linux, or use the "boot" comm= and within U-boot:
=3D> boot