中级会员
- 积分
- 389
- 金钱
- 389
- 注册时间
- 2019-4-25
- 在线时间
- 99 小时
|
楼主 |
发表于 2021-10-21 14:43:48
|
显示全部楼层
谢谢你,我看的手册是《i.MX Linux ® ® User's Guide, Rev. L5.4.47_2.2.0, 2 November 2020》,在烧写zImage和设备树到SD前,确实格式化了SD卡,但是手册介绍的是写到绝对地址处。
- 4.3.5 Copying the kernel image and DTB file
- This section describes how to load the kernel image and DTB when the full SD card image is not used. The pre-built SD card image
- uses the VFAT partition for storing kernel image and DTB, which requires a VFAT partition that is mounted as a Linux drive and
- the files are simply copied into it. This is the preferred method.
- Another method that can be used is for users to put the kernel image and DTB to the fixed raw address of the SD card by using the
- dd command. The later method needs to modify the U-Boot default environment variables for loading the kernel image and DTB.
- Default: VFAT partition
- 1. Format partition 1 on the card as VFAT with this command:
- $ sudo mkfs.vfat /dev/sdx1
- 2. Mount the formatted partition with this command:
- $ mkdir mountpoint
- $ sudo mount /dev/sdx1 mountpoint
- 3. Copy the zImage and *.dtb files to the mountpoint by using cp . The device tree names should match the one used by the
- variable specified by U-Boot. Unmount the partition with this command:
- $ sudo umount mountpoint
- Alternative: Pre-defined raw address
- The following command can be used to copy the kernel image to the SD/MMC card:
- For i.MX 6 and i.MX7, use this command:
- $ sudo dd if=zImage_imx_v7_defconfig of=/dev/sdx bs=512 seek=2048 conv=fsync
- For i.MX 8, use this command:
- sudo dd if=Image-imx8qmsabreauto.bin of=/dev/sdx bs=512 seek=2048 conv=fsync
- Each of them copies the kernel to the media at offset 1 MB (bs x seek = 512 x 2048 = 1 MB). The file zImage_imx_v7_defconfig
- refers to the zImage file created when using the imx_v7_defconfig configuration file, which supports both i.MX 6 and i.MX 7 SoCs.
- The i.MX DTB image can be copied by using the copy command and copying the file to the 2nd partition or the following commands
- copy an i.MX DTB image to the SD/MMC card by using dd command.
- Choose a command for your board:
- $ sudo dd if=zImage-imx6qp-sabreauto.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
- $ sudo dd if=zImage-imx6qp-sabresd.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
- $ sudo dd if=zImage-imx6q-sabreauto.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
- $ sudo dd if=zImage-imx6q-sabresd.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
- $ sudo dd if=zImage-imx6sl-evk.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
- $ sudo dd if=zImage-imx7d-sdb.dtb of=/dev/sdx bs=512 seek=20480 conv=fsync
复制代码 |
|