在MarS board上烧录系统镜像

MarS Board 是基于飞思卡尔(Freescale Semiconductor)i.MX 6Dual 处理器的评估板。i.MX 6Dual 处理器集成了高达 1GHz 的 ARM Cortex™-A9 内核、2D和3D 图形处理器和 3D 1080p 视频处理器。
MarS Board评 估板具备丰富的接口,包括HDMI接口、 LVDS 接口、 Mini USB OTG接口、 Mini USB Debug 接口、RJ45 接口、USB Host 接口、TF 卡接口和 LCD 显示接口,可以帮助开发者针对上 网本、桌面一体机、高端移动互联网设备、高端掌上电脑、高端便携式媒体播放器、游戏 机和便携式导航设备等各类不一样领域进行开发。shell

 

这个板子是国内的英蓓特设计的,网上能直接找的资料不多,官方给的烧写工具是Mfgtools-Rel-12.04.01_ER_MX6Q_UPDATER,可是存在兼容性问题,不支持XP以上系统以及USB3.0ubuntu

我使用的系统是win 8.1 pro,因此只能另外找工具,最终我使用的是Mfgtools-Rel-4.1.0_130816_MX6Q_UPDATER,能够兼容win 8.1,可是仍是须要一个USB HUB将USB3.0转换到2.0工具

使用Mfgtools-Rel-4.1.0_130816_MX6Q_UPDATER要注意在Profiles\MX6Q Linux Update\OS Firmware目录下要有镜像文件,不然烧录工具不能打开网站

这个烧录工具与官方提供的使用方法大体相同,在cfg.ini中要烧录的预配置,配置文件内容以下spa

1 [profiles]
2 chip = MX6Q Linux Update
3 
4 [platform]
5 board = MarS Board
6 
7 [LIST]
8 name = Ubuntu-Marsboard-eMMC

 

我选择的烧写配置为Ubuntu-Marsboard-eMMC,若是要修改,在Profiles\MX6Q Linux Update\OS Firmware目录下ucl2.xml中记录了Ubuntu-Marsboard-eMMC的配置设计

 1 <LIST name="ubuntu-Marsboard-eMMC" desc="Choose eMMC as media">
 2     <CMD state="BootStrap" type="boot" body="BootStrap" file ="u-boot.bin" >Loading U-boot</CMD>
 3     <CMD state="BootStrap" type="load" file="uImage" address="0x10800000"
 4         loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Kernel.</CMD>
 5     <CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot" address="0x10C00000"
 6         loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Initramfs.</CMD>
 7     <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
 8     
 9     <CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd0">Erasing Boot partition</CMD>
10     <CMD state="Updater" type="push" body="send" file="files/u-boot.bin">Sending U-Boot</CMD>
11     <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mtd0 bs=512">write U-Boot to SPI-NOR</CMD>
12     <CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd1">Clear Params</CMD>
13 
14     <CMD state="Updater" type="push" body="send" file="files/uImage">Sending kernel uImage</CMD>
15     <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0 bs=1M seek=1 conv=fsync">write kernel image to sd card</CMD>
16     
17     <CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
18     <CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
19     <CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk0"> Partitioning...</CMD>
20 
21     <CMD state="Updater" type="push" body="$ mkfs.ext3 -j /dev/mmcblk0p1">Formatting rootfs partition</CMD>
22     <CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk0p1"/> 
23     <CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mmcblk0p1 /mnt/mmcblk0p1"/>
24     <CMD state="Updater" type="push" body="pipe tar --numeric-owner -zxv -C /mnt/mmcblk0p1" file="files/oneiric.tgz">Sending and writting rootfs</CMD>
25     <CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
26     <CMD state="Updater" type="push" body="$ umount /mnt/mmcblk0p1">Unmounting rootfs partition</CMD>
27     <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
28   </LIST>

在上面配置的24行code

<CMD state="Updater" type="push" body="pipe tar --numeric-owner -zxv -C /mnt/mmcblk0p1" file="files/oneiric.tgz">Sending and writting rootfs</CMD>

这里设置了烧写用的系统文件镜像为files/oneiric.tgz,也就是用\Profiles\MX6Q Linux Update\OS Firmware\files\oneiric.tgz文件orm

要注意的是,这个烧录方式与树莓派的烧录方式有明显不一样,树莓派的镜像文件只有一个img文件,可是这里分为了三个,分别是u-boot.bin、uImage和oneiric.tgz视频

u-boot.bin是记录引导区的镜像,uImage是Linux内核镜像,oneiric.tgz是文件系统镜像。xml

官方提供了交叉编译工具和源代码,也可以使用Freescale提供的BSP,能够本身精简编译内核,生成u-boot.bin和uImage文件

oneiric.tgz文件则决定了系统的版本号,MarS Board使用的是Ubuntu的衍生版本Linaro,官方自带的oneiric.tgz中是11.10的版本,能够去Linaro的官方网站下载最新版本的镜像,经过替换这个镜像使用更高版本的系统。

若是要使用14.04以上版本的系统,u-boot.bin文件须要下载最新的源码编译生成,不然没法正常引导。

要注意的是因为内核与内核动态模块不是一块儿编译的(内核在uImage中,内核动态模块在oneiric.tgz中),因此有些功能没法使用(如iptables)

 

准备好u-boot.bin、uImage和oneiric.tgz这三个文件就能够开始烧录了,烧录工具会先载入内核文件和引导文件,而后设备自动重启(中途USB会断开一小会儿,又会自动连上)开始烧录

相关文章
相关标签/搜索