[imx6ull]修改nxp官方烧写工具mfgtool

艾恩凝

2021/12/3

image.png

昨晚一顿操作猛如虎,奈何烧写还不对,导致内核启不了,某些细节还是没有搞好,重新检查一下配置,官方的烧写工具改好了

  1. 关注Profiles\Linux\OS Firmware 文件夹中的 files,firmware文件夹与ucl2.xml
  2. files 文件夹中要保留 fsl-image-mfgtool-initramfs-imx6qdlsolo.cpio.gz.u-boot
  3. firmware 文件夹中要保留 fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot和 fsl-image-mfgtool-initramfs-imx6qdlsolo.cpio.gz.u-boot
  4. 另外就是修改ucl2.xml
 1<!--
 2* Copyright (C) 2012, Freescale Semiconductor, Inc. All Rights Reserved.
 3* The CFG element contains a list of recognized usb devices.
 4*  DEV elements provide a name, class, vid and pid for each device.
 5*
 6* Each LIST element contains a list of update instructions.
 7*  "Install" - Erase media and install firmware.
 8*  "Update" - Update firmware only.
 9*
10* Each CMD element contains one update instruction of attribute type.
11*  "pull" - Does UtpRead(body, file) transaction.
12*  "push" - Does UtpWrite(body, file) transaction.
13*  "drop" - Does UtpCommand(body) then waits for device to disconnect.
14*  "boot" - Finds configured device, forces it to "body" device and downloads "file".
15*  "find" - Waits for "timeout" seconds for the "body" device to connect.
16*  "show" - Parse and show device info in "file".  
17-->
18
19
20<UCL>
21  <CFG>
22    <STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
23    <STATE name="BootStrap" dev="MX6ULL" vid="15A2" pid="0080"/>
24    <STATE name="Updater"   dev="MSC" vid="066F" pid="37FF"/>
25  </CFG>
26
27  
28  <LIST name="eMMC" desc="Choose eMMC as media">
29	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-aeneag-emmc.imx" ifdev="MX6ULL">Loading U-boot</CMD>
30	<CMD state="BootStrap" type="load" file="firmware/zImage-aeneag-emmc" address="0x80800000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL MX6ULL">Loading Kernel.</CMD>
31	 
32
33	<CMD state="BootStrap" type="load" file="firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot" address="0x83800000"
34		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6ULL">Loading Initramfs.</CMD>
35
36	<CMD state="BootStrap" type="load" file="firmware/imx6ull-aeneag-emmc.dtb" address="0x83000000"
37		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6ULL">Loading device tree.</CMD>
38
39	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
40
41
42	<!-- create partition -->
43	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
44	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
45	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>
46
47	<!-- burn uboot -->
48	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=8">clear u-boot arg</CMD>
49	<!-- access boot partition -->
50	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
51
52	<CMD state="Updater" type="push" body="send" file="files/u-boot-aeneag-emmc.imx" ifdev="MX6ULL">Sending u-boot.bin</CMD>
53
54	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
55	<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
56	<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>
57
58	<!-- create fat partition -->
59	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
60	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
61	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
62	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>
63
64	<!-- burn zImage -->
65	<CMD state="Updater" type="push" body="send" file="files/zImage-aeneag-emmc">Sending kernel zImage</CMD>
66	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/zImage">write kernel image to sd card</CMD>
67
68	<!-- burn dtb -->
69
70	<CMD state="Updater" type="push" body="send" file="files/imx6ull-aeneag-emmc.dtb" ifdev="MX6ULL">Sending Device Tree file</CMD>
71	<CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblk%mmc%p1/imx6ull-aeneag-emmc.dtb" ifdev="MX6ULL">write device tree to sd card</CMD>
72	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p1">Unmounting vfat partition</CMD>
73
74	<!-- burn rootfs -->
75	<CMD state="Updater" type="push" body="$ mkfs.ext3 -F -E nodiscard /dev/mmcblk%mmc%p2">Formatting rootfs partition</CMD>
76	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p2"/>
77	<CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk%mmc%p2 /mnt/mmcblk%mmc%p2"/>
78	<CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk%mmc%p2" file="files/rootfs-aeneag-emmc.tar.bz2" ifdev="MX6UL MX7D MX6ULL">Sending and writting rootfs</CMD>
79	<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
80	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p2">Unmounting rootfs partition</CMD>
81	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
82  </LIST>
83
84
85</UCL>
86
  1. files文件夹中

image.png

  1. firmware文件夹中

image.png

关键的就是这些,这里没有具体的操作细节,做网上搬运工没有意义


    


公众号'艾恩凝'
个人公众号
个人微信
个人微信
    吾心信其可行,
          则移山填海之难,
                  终有成功之日!
                                  ——孙文
    评论
    2 评论
    2021-12-06 13:17 回复»

    123
    2021-12-06 12:06 回复»

    测试

avatar

取消