打印
[其它]

【MY-iMX6UL套件试用】+2. 固件烧录工具学习

[复制链接]
1339|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
skawu|  楼主 | 2018-4-8 16:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这次来学习下MfgTool工具

首先看下 cfg.ini 文件
[profiles]
chip=Linux
[platform]
board=MY-IMX6
[LIST]
name=Linux-4.1.15
[variable]
ek_name=myimx6ek140p
ek_spec=6g
rootfs_l4115_file=fsl-image-qt5-myimx6a9.tar.bz2


从官网找到了段说明:The “profiles/chip” indicates the target profile name which should match with the target folder name at "profiles/", and the “list/name” entry indicates the target operation list name which should match with the LIST tag entry in the ucl2.xml file located at "profiles/Kinetis bootloader/OS Firmware/". The “platform/board” is reserved and not used.


chip : 和 my-imx6-mfgtool-lib262\Profiles 目录下的文件夹名字对应,选择芯片类型,这里是填写的 Linux,所以会自动的找到 my-imx6-mfgtool-lib262\Profiles 目录下的Linux文件夹中的内容
board:没有用到,保留
name:就是下面要说的烧录步骤,对应 ucl2.xml 文件的内容,注意看下面 LIST name 的内容!
 <LIST name="Linux-4.1.15" desc="Target OS: Linux-4.1.15">
        <!-- loading firmware OS -->
        <CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware-4115/uboot-%ek_name%-%ek_spec%.imx">boot: u-boot.imx</CMD>
        
        <CMD state="BootStrap" type="load" file="firmware-4115/mfg-zImage-myimx6" address="0x12000000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: mfg-zImage-myimx6</CMD>
        <CMD state="BootStrap" type="load" file="firmware-4115/mfg-zImage-myimx6" address="0x80800000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: mfg-zImage-myimx6</CMD>
               
        <CMD state="BootStrap" type="load" file="firmware-4115/fsl-image-mfgtool-initramfs" address="0x12C00000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: initramfs</CMD>
        <CMD state="BootStrap" type="load" file="firmware-4115/fsl-image-mfgtool-initramfs" address="0x83800000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: initramfs</CMD>
               
        <CMD state="BootStrap" type="load" file="firmware-4115/%ek_name%-%ek_spec%.dtb" address="0x18000000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: device tree.</CMD>
        <CMD state="BootStrap" type="load" file="firmware-4115/%ek_name%-%ek_spec%.dtb" address="0x83000000"
                loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: device tree</CMD>
               
        <CMD state="BootStrap" type="jump">jump: OS image</CMD>
        
        <!-- create partition -->
        <CMD state="Updater" type="push" body="send" file="firmware-4115/mksdcard-4115.sh.tar">send: mksdcard.sh.tar</CMD>
        <CMD state="Updater" type="push" body="$ tar xf $FILE ">exec: tar mksdcard.sh.tar</CMD>
        <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk3" ifdev="MX6Q MX6D">exec: sh mksdcard.sh</CMD>
        <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk1" ifdev="MX6UL MX6ULL">exec: sh mksdcard.sh</CMD>
        
        <!-- burn uboot -->
        <CMD state="Updater" type="push" body="$ flash_erase /dev/mtd0 0 0" ifdev="MX6Q MX6D">exec: erase spi flash</CMD>
        <CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=768 conv=fsync count=8" ifdev="MX6UL MX6ULL">exec: clear u-boot args</CMD>
        
        <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-uboot/uboot-%ek_name%-%ek_spec%.imx">send: u-boot.imx</CMD>
        
        <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mtd0 bs=1k seek=1" ifdev="MX6Q MX6D">exec: write u-boot.imx</CMD>
        <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk1 bs=512 seek=2" ifdev="MX6UL MX6ULL">exec: write u-boot.imx</CMD>
        
        <!-- burn kernel & dtb -->
        <CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk3p1" ifdev="MX6Q MX6D">exec: mkfs.vfat mmcblk</CMD>
        <CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk1p1" ifdev="MX6UL MX6ULL">exec: mkfs.vfat mmcblk</CMD>
        
        <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblkxp1">exec: mkdir mnt_vfat_dir</CMD>
        <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk3p1 /mnt/mmcblkxp1" ifdev="MX6Q MX6D">exec: mount vfat</CMD>
        <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblkxp1" ifdev="MX6UL MX6ULL">exec: mount vfat</CMD>
        
        <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-kernel/zImage-myimx6a9" ifdev="MX6Q MX6D">send: zImage-myimx6</CMD>
        <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-kernel/zImage-myimx6a7" ifdev="MX6UL MX6ULL">send: zImage-myimx6g</CMD>
        <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/zImage-myimx6a9" ifdev="MX6Q MX6D">exec: write zImage-myimx6</CMD>
        <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/zImage-myimx6a7" ifdev="MX6UL MX6ULL">exec: write zImage-myimx6g</CMD>
        
        <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-dtb/%ek_name%-%ek_spec%.dtb">send: device tree</CMD>
        <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/%ek_name%-%ek_spec%.dtb">exec: write device tree</CMD>
        
        <CMD state="Updater" type="push" body="$ umount /mnt/mmcblkxp1">exec: umount vfat</CMD>
        
        <!-- burn rootfs -->
        <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -j /dev/mmcblk3p2" ifdev="MX6Q MX6D">exec: mkfs.ext3 mmcblk</CMD>
        <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -j /dev/mmcblk1p2" ifdev="MX6UL MX6ULL">exec: mkfs.ext3 mmcblk</CMD>
        
        <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblkxp2">exec: mkdir mnt_ext3_dir</CMD>
        <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk3p2 /mnt/mmcblkxp2" ifdev="MX6Q MX6D">exec: mount ext3</CMD>
        <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk1p2 /mnt/mmcblkxp2" ifdev="MX6UL MX6ULL">exec: mount ext3</CMD>
        
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-4115/image-rootfs/%rootfs_l4115_file%">pipe: rootfs</CMD>
        <CMD state="Updater" type="push" body="frf">frf: rootfs</CMD>
        
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-4115/image-kernel/kernel-modules-myimx6a9.tar.bz2" ifdev="MX6Q MX6D">pipe: kernel modules</CMD>
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-4115/image-kernel/kernel-modules-myimx6a7.tar.bz2" ifdev="MX6UL MX6ULL">pipe: kernel modules</CMD>
        <CMD state="Updater" type="push" body="frf">frf: kernel modules</CMD>
        
        <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2/home/root" file="image-linux-4115/my-demo.tar.bz2">pipe: myzr demo</CMD>
        <CMD state="Updater" type="push" body="frf">frf: myzr demo</CMD>
        
        <CMD state="Updater" type="push" body="$ umount /mnt/mmcblkxp2">exec: umount mmcblk</CMD>
        
        <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
  </LIST>
这样就对应起来了,具体的步骤就是上面这段,再来看的话就能看懂了。


相关帖子

沙发
巧克力娃娃| | 2018-4-9 08:33 | 只看该作者

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

110

帖子

0

粉丝