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

[复制链接]
323|1
 楼主 | 2018-4-8 16:14 | 显示全部楼层 |阅读模式
这次来学习下MfgTool工具

首先看下 cfg.ini 文件
  1. [profiles]
  2. chip=Linux
  3. [platform]
  4. board=MY-IMX6
  5. [LIST]
  6. name=Linux-4.1.15
  7. [variable]
  8. ek_name=myimx6ek140p
  9. ek_spec=6g
  10. 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 的内容!
  1. <LIST name="Linux-4.1.15" desc="Target OS: Linux-4.1.15">
  2.         <!-- loading firmware OS -->
  3.         <CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware-4115/uboot-%ek_name%-%ek_spec%.imx">boot: u-boot.imx</CMD>
  4.         
  5.         <CMD state="BootStrap" type="load" file="firmware-4115/mfg-zImage-myimx6" address="0x12000000"
  6.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: mfg-zImage-myimx6</CMD>
  7.         <CMD state="BootStrap" type="load" file="firmware-4115/mfg-zImage-myimx6" address="0x80800000"
  8.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: mfg-zImage-myimx6</CMD>
  9.                
  10.         <CMD state="BootStrap" type="load" file="firmware-4115/fsl-image-mfgtool-initramfs" address="0x12C00000"
  11.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: initramfs</CMD>
  12.         <CMD state="BootStrap" type="load" file="firmware-4115/fsl-image-mfgtool-initramfs" address="0x83800000"
  13.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: initramfs</CMD>
  14.                
  15.         <CMD state="BootStrap" type="load" file="firmware-4115/%ek_name%-%ek_spec%.dtb" address="0x18000000"
  16.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q MX6D">load: device tree.</CMD>
  17.         <CMD state="BootStrap" type="load" file="firmware-4115/%ek_name%-%ek_spec%.dtb" address="0x83000000"
  18.                 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL MX6ULL">load: device tree</CMD>
  19.                
  20.         <CMD state="BootStrap" type="jump">jump: OS image</CMD>
  21.         
  22.         <!-- create partition -->
  23.         <CMD state="Updater" type="push" body="send" file="firmware-4115/mksdcard-4115.sh.tar">send: mksdcard.sh.tar</CMD>
  24.         <CMD state="Updater" type="push" body="$ tar xf $FILE ">exec: tar mksdcard.sh.tar</CMD>
  25.         <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk3" ifdev="MX6Q MX6D">exec: sh mksdcard.sh</CMD>
  26.         <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk1" ifdev="MX6UL MX6ULL">exec: sh mksdcard.sh</CMD>
  27.         
  28.         <!-- burn uboot -->
  29.         <CMD state="Updater" type="push" body="$ flash_erase /dev/mtd0 0 0" ifdev="MX6Q MX6D">exec: erase spi flash</CMD>
  30.         <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>
  31.         
  32.         <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-uboot/uboot-%ek_name%-%ek_spec%.imx">send: u-boot.imx</CMD>
  33.         
  34.         <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>
  35.         <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>
  36.         
  37.         <!-- burn kernel & dtb -->
  38.         <CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk3p1" ifdev="MX6Q MX6D">exec: mkfs.vfat mmcblk</CMD>
  39.         <CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk1p1" ifdev="MX6UL MX6ULL">exec: mkfs.vfat mmcblk</CMD>
  40.         
  41.         <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblkxp1">exec: mkdir mnt_vfat_dir</CMD>
  42.         <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk3p1 /mnt/mmcblkxp1" ifdev="MX6Q MX6D">exec: mount vfat</CMD>
  43.         <CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblkxp1" ifdev="MX6UL MX6ULL">exec: mount vfat</CMD>
  44.         
  45.         <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-kernel/zImage-myimx6a9" ifdev="MX6Q MX6D">send: zImage-myimx6</CMD>
  46.         <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-kernel/zImage-myimx6a7" ifdev="MX6UL MX6ULL">send: zImage-myimx6g</CMD>
  47.         <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/zImage-myimx6a9" ifdev="MX6Q MX6D">exec: write zImage-myimx6</CMD>
  48.         <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/zImage-myimx6a7" ifdev="MX6UL MX6ULL">exec: write zImage-myimx6g</CMD>
  49.         
  50.         <CMD state="Updater" type="push" body="send" file="image-linux-4115/image-dtb/%ek_name%-%ek_spec%.dtb">send: device tree</CMD>
  51.         <CMD state="Updater" type="push" body="$ cp $FILE /mnt/mmcblkxp1/%ek_name%-%ek_spec%.dtb">exec: write device tree</CMD>
  52.         
  53.         <CMD state="Updater" type="push" body="$ umount /mnt/mmcblkxp1">exec: umount vfat</CMD>
  54.         
  55.         <!-- burn rootfs -->
  56.         <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -j /dev/mmcblk3p2" ifdev="MX6Q MX6D">exec: mkfs.ext3 mmcblk</CMD>
  57.         <CMD state="Updater" type="push" body="$ mkfs.ext3 -F -j /dev/mmcblk1p2" ifdev="MX6UL MX6ULL">exec: mkfs.ext3 mmcblk</CMD>
  58.         
  59.         <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblkxp2">exec: mkdir mnt_ext3_dir</CMD>
  60.         <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk3p2 /mnt/mmcblkxp2" ifdev="MX6Q MX6D">exec: mount ext3</CMD>
  61.         <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk1p2 /mnt/mmcblkxp2" ifdev="MX6UL MX6ULL">exec: mount ext3</CMD>
  62.         
  63.         <CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblkxp2" file="image-linux-4115/image-rootfs/%rootfs_l4115_file%">pipe: rootfs</CMD>
  64.         <CMD state="Updater" type="push" body="frf">frf: rootfs</CMD>
  65.         
  66.         <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>
  67.         <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>
  68.         <CMD state="Updater" type="push" body="frf">frf: kernel modules</CMD>
  69.         
  70.         <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>
  71.         <CMD state="Updater" type="push" body="frf">frf: myzr demo</CMD>
  72.         
  73.         <CMD state="Updater" type="push" body="$ umount /mnt/mmcblkxp2">exec: umount mmcblk</CMD>
  74.         
  75.         <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
  76.   </LIST>
复制代码
这样就对应起来了,具体的步骤就是上面这段,再来看的话就能看懂了。


| 2018-4-9 08:33 | 显示全部楼层
扫描二维码,随时随地手机跟帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复

您需要登录后才可以回帖
登录 | 注册
高级模式
我要创建版块 申请成为版主

论坛热帖

关闭

热门推荐上一条 /6 下一条

分享 快速回复 返回顶部 返回列表