飞思卡尔烧写工具mfgtools的使用
生活随笔
收集整理的這篇文章主要介紹了
飞思卡尔烧写工具mfgtools的使用
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
注意:當(dāng)時(shí)遇到燒錄之后各種重啟問題,還有system.img 文件同步不過去的原因,都是因?yàn)闆]有加flash刷新
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
MFGTool是飛思卡爾提供的燒寫工具,使用起來非常方便。但是,在使用MFGTool有幾點(diǎn)是需要注意的,否則就會(huì)在燒寫過程中遇到一些問題:
1、在使用MFGTool前,文件cfg.ini?和?UICfg.ini是必須要在同一個(gè)文件夾下,同時(shí)這兩個(gè)文件一定要配置正確。
???????? UICfg.ini用來配置每次同時(shí)可以燒寫開發(fā)板的個(gè)數(shù):
???????????? [UICfg]
???????????? PortMgrDlg=1
???????cfg.ini用來配置芯片類型和板子信息以及燒寫內(nèi)容存儲(chǔ)方式:
[profiles]
chip = MX6DL Linux Update?? -----------芯片為i.mx6dl
?
[platform]
board = SabreSD?????????????????????? ------------板子型號(hào)
?
[LIST]
name = i.MX6DL-ubuntu-SabreSD-SD ---------------燒寫內(nèi)容及存儲(chǔ)方式
cfg.ini一定要根據(jù)你的板子和要燒寫到哪里來設(shè)置,設(shè)置的信息和你使用的板子要匹配。
2、ucl2.xml
MFGTool燒寫過程是完全按照ucl2.xml進(jìn)行的。具體ucl2.xml的內(nèi)容你可以到MFGTool-Dir/Profiles/MX6DL Linux Update/OS Firmware下查看。ucl2.xml中的燒寫命令為linux命令(文檔Manufacturing Tool V2 Quick Start Guide中有介紹)這里不再詳述。
3、boot mode方式要正確
在燒寫前要設(shè)置板子為下載模式,才可以進(jìn)行燒寫。
總結(jié)一下使用MFGTool燒寫過程如下:
1)配置cfg.ini和UICfg.ini文件
2)設(shè)置boot mode為download模式
3)用OTG-USB線連接開發(fā)板和PC機(jī)
4)打開終端,并運(yùn)行MfgTool2.exe
5)給開發(fā)板上電,出現(xiàn)如下HID-compliant device,點(diǎn)擊Start開始下載。
?
4、如何使用MFGTool燒寫image到你自己設(shè)計(jì)的板子上??
編譯生成板子上需要跑的U-boot、uImage和文件系統(tǒng)rootfs(具體操作查看你參考設(shè)計(jì)的板子的User Guider中有詳細(xì)的步驟和介紹)
Sending U-Boot
write U-Boot to sd card
Sending kernel uImage
write kernel image to sd card………….
???? Sending and writting rootfs
根據(jù)ucl2.xml文件中的內(nèi)容來創(chuàng)建你自己設(shè)計(jì)板子的燒寫過程,只要修改原有的U-Boot?和?kernel就夠了。
?
? 以下時(shí)ucl2.xml文件:
?<CFG>
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/><STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/> <STATE name="Updater"?? dev="MSC" vid="066F" pid="37FF"/>
</CFG>
//全局變量?
//ucl2.xml將燒錄過程分成兩個(gè)階段:BootStrap和Updater?
//dev、vid和pid:分別對(duì)應(yīng)兩個(gè)階段的設(shè)備名、設(shè)備對(duì)應(yīng)連接的USB?vid和pid號(hào)?
//針對(duì)imx6系列,在?BootStrap階段,有效的設(shè)備名只有MX6Q、MX6D、MX6SL。在Updater階段,有效的設(shè)備名只有MSC
<LIST name="Android-Marsboard-eMMC" desc="Choose eMMC as media">
//根據(jù)cfg.ini 文件中定義的name 選擇(ucl2.xml中LIST name要與cfg.ini文件中定義的name相對(duì)應(yīng))
<CMD state="BootStrap" type="boot" body="BootStrap" file="u-boot.bin">Loading U-boot</CMD>
//下載當(dāng)前目錄的u-boot.bin 文件到RAM
<CMD state="BootStrap" type="load" file="uImage" address="0x10800000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Kernel.</CMD>
//下載當(dāng)前目錄的uImage文件到RAM的0x10800000地址處
<CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot" address="0x10C00000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Initramfs.</CMD>
//下載當(dāng)前目錄的initramfs.cpio.gz.uboot文件到內(nèi)存的0x10C00000地址處
<CMD state="BootStrap" type="jump"> Jumping to OS image. </CMD>
//通知內(nèi)嵌ROM代碼跳轉(zhuǎn)到內(nèi)存中的鏡像執(zhí)行
<CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd0">Erasing Boot partition</CMD>
//擦除信息mtd0
<CMD state="Updater" type="push" body="send" file="files/android/u-boot.bin">Sending U-Boot</CMD>
//將files/android/u-boot.bin文件發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mtd0 bs=512">write U-Boot to SPI-NOR</CMD>
//燒寫將$FILE下載到/dev/mtd0位置,bs=512,指定讀/寫的blocks大小為512bytes
<CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd1">Clear Params</CMD>
//擦除信息mtd1
<CMD state="Updater" type="push" body="send" file="mksdcard-android.sh.tar">Sending partition shell</CMD>
//將files/android/u-boot.bin文件發(fā)送到目標(biāo)機(jī)
//將當(dāng)前目錄的mksdcard-android.sh.tar 分區(qū)腳本文件,發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
//解壓腳本文件
<CMD state="Updater" type="push" body="$ sh mksdcard-android.sh /dev/mmcblk0"> Partitioning...</CMD>
//執(zhí)行腳本文件
<CMD state="Updater" type="push" body="$ ls -l /dev/mmc* ">Formatting sd partition</CMD>
//從下面開始燒錄內(nèi)核、文件系統(tǒng)
<CMD state="Updater" type="push" body="send" file="files/android/boot.img">Sending kernel uImage</CMD>
//將files/android/boot.img 發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0p1">write boot.img</CMD>
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
//刷新,等待數(shù)據(jù)傳送完成
<CMD state="Updater" type="push" body="$ mkfs.ext4 -b 4096 -m 0 /dev/mmcblk0p4">Formatting data partition</CMD>
<CMD state="Updater" type="push" body="send" file="mk-encryptable-data-android.sh.tar">Sending data partition shell</CMD>
<CMD state="Updater" type="push" body="$ tar xf $FILE ">Extracting data partition shell</CMD>
<CMD state="Updater" type="push" body="$ sh mk-encryptable-data-android.sh /dev/mmcblk0 /dev/mmcblk0p4">Making data encryptable</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p5">Formatting system partition</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p6">Formatting cache partition</CMD>
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p7">Formatting device partition</CMD>?
<CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk0p5 bs=512" file="files/android/system.img">Sending and writting system.img</CMD>
//利用pipe 傳輸大數(shù)據(jù)
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
//執(zhí)行flush刷新操作,等到數(shù)據(jù)傳輸完畢
MFGTool是飛思卡爾提供的燒寫工具,使用起來非常方便。但是,在使用MFGTool有幾點(diǎn)是需要注意的,否則就會(huì)在燒寫過程中遇到一些問題:
1、在使用MFGTool前,文件cfg.ini?和?UICfg.ini是必須要在同一個(gè)文件夾下,同時(shí)這兩個(gè)文件一定要配置正確。
???????? UICfg.ini用來配置每次同時(shí)可以燒寫開發(fā)板的個(gè)數(shù):
???????????? [UICfg]
???????????? PortMgrDlg=1
???????cfg.ini用來配置芯片類型和板子信息以及燒寫內(nèi)容存儲(chǔ)方式:
[profiles]
chip = MX6DL Linux Update?? -----------芯片為i.mx6dl
?
[platform]
board = SabreSD?????????????????????? ------------板子型號(hào)
?
[LIST]
name = i.MX6DL-ubuntu-SabreSD-SD ---------------燒寫內(nèi)容及存儲(chǔ)方式
cfg.ini一定要根據(jù)你的板子和要燒寫到哪里來設(shè)置,設(shè)置的信息和你使用的板子要匹配。
2、ucl2.xml
MFGTool燒寫過程是完全按照ucl2.xml進(jìn)行的。具體ucl2.xml的內(nèi)容你可以到MFGTool-Dir/Profiles/MX6DL Linux Update/OS Firmware下查看。ucl2.xml中的燒寫命令為linux命令(文檔Manufacturing Tool V2 Quick Start Guide中有介紹)這里不再詳述。
3、boot mode方式要正確
在燒寫前要設(shè)置板子為下載模式,才可以進(jìn)行燒寫。
總結(jié)一下使用MFGTool燒寫過程如下:
1)配置cfg.ini和UICfg.ini文件
2)設(shè)置boot mode為download模式
3)用OTG-USB線連接開發(fā)板和PC機(jī)
4)打開終端,并運(yùn)行MfgTool2.exe
5)給開發(fā)板上電,出現(xiàn)如下HID-compliant device,點(diǎn)擊Start開始下載。
?
4、如何使用MFGTool燒寫image到你自己設(shè)計(jì)的板子上??
編譯生成板子上需要跑的U-boot、uImage和文件系統(tǒng)rootfs(具體操作查看你參考設(shè)計(jì)的板子的User Guider中有詳細(xì)的步驟和介紹)
Sending U-Boot
write U-Boot to sd card
Sending kernel uImage
write kernel image to sd card………….
???? Sending and writting rootfs
根據(jù)ucl2.xml文件中的內(nèi)容來創(chuàng)建你自己設(shè)計(jì)板子的燒寫過程,只要修改原有的U-Boot?和?kernel就夠了。
?
? 以下時(shí)ucl2.xml文件:
?<CFG>
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/><STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/> <STATE name="Updater"?? dev="MSC" vid="066F" pid="37FF"/>
</CFG>
//全局變量?
//ucl2.xml將燒錄過程分成兩個(gè)階段:BootStrap和Updater?
//dev、vid和pid:分別對(duì)應(yīng)兩個(gè)階段的設(shè)備名、設(shè)備對(duì)應(yīng)連接的USB?vid和pid號(hào)?
//針對(duì)imx6系列,在?BootStrap階段,有效的設(shè)備名只有MX6Q、MX6D、MX6SL。在Updater階段,有效的設(shè)備名只有MSC
<LIST name="Android-Marsboard-eMMC" desc="Choose eMMC as media">
//根據(jù)cfg.ini 文件中定義的name 選擇(ucl2.xml中LIST name要與cfg.ini文件中定義的name相對(duì)應(yīng))
<CMD state="BootStrap" type="boot" body="BootStrap" file="u-boot.bin">Loading U-boot</CMD>
//下載當(dāng)前目錄的u-boot.bin 文件到RAM
<CMD state="BootStrap" type="load" file="uImage" address="0x10800000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Kernel.</CMD>
//下載當(dāng)前目錄的uImage文件到RAM的0x10800000地址處
<CMD state="BootStrap" type="load" file="initramfs.cpio.gz.uboot" address="0x10C00000" loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Initramfs.</CMD>
//下載當(dāng)前目錄的initramfs.cpio.gz.uboot文件到內(nèi)存的0x10C00000地址處
<CMD state="BootStrap" type="jump"> Jumping to OS image. </CMD>
//通知內(nèi)嵌ROM代碼跳轉(zhuǎn)到內(nèi)存中的鏡像執(zhí)行
<CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd0">Erasing Boot partition</CMD>
//擦除信息mtd0
<CMD state="Updater" type="push" body="send" file="files/android/u-boot.bin">Sending U-Boot</CMD>
//將files/android/u-boot.bin文件發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mtd0 bs=512">write U-Boot to SPI-NOR</CMD>
//燒寫將$FILE下載到/dev/mtd0位置,bs=512,指定讀/寫的blocks大小為512bytes
<CMD state="Updater" type="push" body="$ flash_eraseall /dev/mtd1">Clear Params</CMD>
//擦除信息mtd1
<CMD state="Updater" type="push" body="send" file="mksdcard-android.sh.tar">Sending partition shell</CMD>
//將files/android/u-boot.bin文件發(fā)送到目標(biāo)機(jī)
//將當(dāng)前目錄的mksdcard-android.sh.tar 分區(qū)腳本文件,發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
//解壓腳本文件
<CMD state="Updater" type="push" body="$ sh mksdcard-android.sh /dev/mmcblk0"> Partitioning...</CMD>
//執(zhí)行腳本文件
<CMD state="Updater" type="push" body="$ ls -l /dev/mmc* ">Formatting sd partition</CMD>
//從下面開始燒錄內(nèi)核、文件系統(tǒng)
<CMD state="Updater" type="push" body="send" file="files/android/boot.img">Sending kernel uImage</CMD>
//將files/android/boot.img 發(fā)送到目標(biāo)機(jī)
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0p1">write boot.img</CMD>
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
//刷新,等待數(shù)據(jù)傳送完成
<CMD state="Updater" type="push" body="$ mkfs.ext4 -b 4096 -m 0 /dev/mmcblk0p4">Formatting data partition</CMD>
<CMD state="Updater" type="push" body="send" file="mk-encryptable-data-android.sh.tar">Sending data partition shell</CMD>
<CMD state="Updater" type="push" body="$ tar xf $FILE ">Extracting data partition shell</CMD>
<CMD state="Updater" type="push" body="$ sh mk-encryptable-data-android.sh /dev/mmcblk0 /dev/mmcblk0p4">Making data encryptable</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p5">Formatting system partition</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p6">Formatting cache partition</CMD>
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext4 /dev/mmcblk0p7">Formatting device partition</CMD>?
<CMD state="Updater" type="push" body="pipe dd of=/dev/mmcblk0p5 bs=512" file="files/android/system.img">Sending and writting system.img</CMD>
//利用pipe 傳輸大數(shù)據(jù)
<CMD state="Updater" type="push" body="frf">flush the memory.</CMD>
//執(zhí)行flush刷新操作,等到數(shù)據(jù)傳輸完畢
總結(jié)
以上是生活随笔為你收集整理的飞思卡尔烧写工具mfgtools的使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux驱动调试中的Debugfs的使
- 下一篇: linux kernel 中mdelay