I.MX6 Manufacturing Tool V2 (MFGTool2) Update Command List (UCL) User Guide translate
Manufacturing Tool V2 (MFGTool2)
Update Command List (UCL) User Guide
Contents(目录)
Contents(目录) 1
1 Overview(概述) 2
2 UTP mode operation(UTP模式操作) 2
2.1 Global Configuration(全局配置) 2
2.2 Update Command List(更新命令列表) 3
2.2.1 Host Specific Commands(主机命令) 3
2.2.2 Firmware Specific Commands(固件命令) 5
1 Overview(概述)
Manufacturing (Mfg) tool provides a flexible way for users to set their own operations. An xml script file is used to configure the users operation.
An xml file typically consists of a number of tasks which can be executed by running the manufacturing tool just once.
Mfg工具给用户提供了一种灵活的方式来设置用户自己的操作。xml脚本文件用于配置用户操作。xml文件通常包含一系列将要被Mfg工具运行的操作,每次只能被运行一次。
2 UTP mode operation(UTP模式操作)
2.1 Global Configuration(全局配置)
Mfg tool uses global configuration to recognize which device the user wants to flash among different USB devices connected to the PC.
当前连接到PC机上USB设备可能很多,Mfg工具使用全局配置来选择对哪一个USB设备进行程序烧入。
Let’s explain it by an example.举个例子看看
1 <CFG> 2 <STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/> 3 <STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/> 4 </CFG>
Global configuration is contained between parameter <CFG> and </CFG>
全局配置是包含在<CFG>和</CFG>之间的参数
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/> indicates the first phase of the burning process, the phase name is “BootStrap”, and a device named “MX6Q” should be connected with the USB pid “0054” and vid “15A2”. For i.MX 6 serial, in the phase “BootStrap”, the valid strings for dev are: “MX6Q”, “MX6D”, “MX6SL”; in the phase “Updater”, the valid string for dev is: “MSC”.
<STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>指定烧写过程的第一个阶段,阶段的名字叫“BootStrap”,设备名叫“MX6Q”,并且这个设备实际上就是USB的pid为“0054”和vid为“15A2”的设备(USB(Universal Serial BUS,通用串行总线)协议规定,所有的USB设备都有VID(Vendor ID,供应商识别码)和PID(Product ID,产品识别码))。对于i.MX6系列,在“BootStrap”阶段,设备有效字符串有:“MX6Q”、“MX6D”,“MX6SL”,在“Updater”阶段,设备有效字符串为:“MSC”。
<STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/> indicates the second phase of the burning process, the phase name is “Updater”, and a device named “MSC” should be connected with the USB pid “37FF” and vid “066F”.
<STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/> 指定烧写过程的第二个阶段,这个阶段的名字叫“Updater”,设备名为“MSC”,也就是USB的pid为“37FF”和vid为“066F”的设备。
2.2 Update Command List(更新命令列表)
The tool uses Update Command List (UCL) to specify all the user tasks. The UCL contains a distinct list for each use case. Each list contains a set of command elements with attributes for the command type, body, and payload. The command element text provides a user interface message for the current operation.
Mfg工具使用更新命令列表(UCL)来指定所有的用户任务。包含一个不同的列表为每个用例,每个用例对应一个目标列表,每一个目标列表抱哈 了一系列的命令元素,每个命令元素由命令类型、命令实体、命令有效载荷,命令元素文本内容提为当前操作的用户操作信息
Each UCL begins from <LIST name=”xx”, desc=”xxx”> while ending with </LIST>, the name of which can be specified by users. Parameter “desc” is used for comment purpose.
There are two types of commands: host specific commands and firmware specific commands. Host specific commands are parsed and executed by host tool while firmware specific commands are parsed and executed by firmware runs on targeted device.
每一个UCL以<LIST name=”xx”, desc=”xxx”>开始,并以</LIST>结束,“name”可以由用户自己指定,参数“desc”用于说明用途。这其中有2种命令:主机命令和固件命令。主机命令被主机工具(Mfg工具)解析并执行,固件命令被目标设备解析并执行。
2.2.1 Host Specific Commands(主机命令)
The example below shows a typical command. “state” indicates the phase of the command executed and “type” specifies the type of a command. “body” is a parameter of the command. “file” is another parameter. “Loading Kernel” is a description of the command.
下面这个例子向我们展示一个典型的命令:
“state”指定命令执行的阶段;
“type”指定了命令的类型;
“body”是命令参数(这里不是指shell命令的参数,是指type命令的参数,可以是shell命令+shell命令参数);
“file”是其他参数中的一种,指定要加载的文件;
“Loading Kernel”是命令的描述,用于描述这条命令用于做什么。
1 <CMD state="BootStrap" type="load" file="uImage" address="0x10800000" 2 loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Kernel.</CMD>
Command type(命令类型) |
Body(命令参数) |
Other parameters(其他参数) |
Description(命令描述) |
load |
|
file Address loadSection setSection HasFlashHeader CodeOffset |
Download an image to RAM. It is strongly recommended to follow the example provided in release package since it involves ROM code parameters which may not be easy to understand. 下载一个image到RAM中,强烈建议依照发行包中的设置,不要修改,因为它涉及到ROM的代码参数,而这些参数又不容易理解。 file: specify the path and name of the image file. Parameter “address” specifies the RAM address where the image is located. file:指定image文件的路径和名字,参数“address”指定将image文件加载到RAM中的地址 loadSection: a parameter used by ROM code, should be set to “OTH” loadSection:该参数被ROM代码使用,必须设置为“OTH” setSection: a parameter used by ROM code, should be set to “OTH” if there are other images to be loaded; set to “APP” if the last image is loaded. loadSection:该参数被ROM代码使用,如果有另外一个image需要加载,必须设置为“OTH”,如果是最后一个image,那么设置为“APP” HasFlashHeader: set TRUE if the image contains a flash header, or set to FALSE. HasFlashHeader:如果image中包含flash头,设为TRUE;如果没有,则设为FALSE。 CodeOffset: the address offset of first executed instruct within the image. CodeOffset:在image中,第一条被执行的执行的偏移。 The command is only for Bulk-IO mode i.MX device except i.MX50 HID mode device. 这个命令除了i.MX50 有HID模式外,其他的i.MX设备都仅仅只有Bulk-IO模式 |
jump |
|
|
Notify ROM code to jump to the RAM image to run. The command must be followed after a load command in which setSection value is set to “APP”. 通知ROM代码跳到RAM中的image的地方去执行。这条命令必须紧紧跟随在属性setSection的值为“APP”的的命令之后。 The command is only for Bulk-IO mode i.MX device except i.MX50 HID mode device. 这个命令除了i.MX50 有HID模式外,其他的i.MX设备都仅仅只有Bulk-IO模式
|
boot |
Recovery |
File if |
Download an image to RAM. 下载image到RAM中去 |
2.2.2 Firmware Specific Commands(固件命令)
If a command is typed as “push”, which means the command is parsed and executed by the targeted device instead of host, the only thing host has to do is to send the command to the targeted device.
如果命令类型是“push”,这个命令也就意味这是被目标设备执行,主机唯一要做的就是发送命令道目标设备
The commands actually executed by OS image are downloaded in Command lists. As a result, each OS has its own commands.
被OS image执行的命令被下载在Command lists中,因此,每个OS都有自己的commands
Command |
Arguments |
Description |
? |
None |
Request to send the device identity information in XML form 请求以XML的形式发送设备确认信息 |
! |
integer |
Initiate the reboot depending on argument. 3 means reboot while 根据参数重新启动。3表示重新启动,而其他值将强制关机。 |
$ |
string |
Execute shell command 执行shell命令 例如 |
flush |
None |
Wait for all data transfer to be finished and processed. 等待所有的数据发送完毕并被执行 |
ffs |
None |
Partition the SD card and flash the boot stream to it. 对SD卡分区并刷入启动流。 |
mknod |
device_class, |
Create the device node by parsing sysfs entry. 创建设备节点通过解析sysfs条目。 例如 |
read |
string |
Read the file specified by parameter and send it to the host. If 读取参数指定文件并且发送到主机,如果文件不存在,将返回适当的状态。 |
send |
None |
Receive the file from the host. Subsequent shell commands can 从主机接受收文件,随后的shell命令可以引用这个文件通过$FILE. |
selftest |
None |
Perform self-diagnostic; returns either pass or appropriate 进行自我诊断,返回或通过适当的状态。当前版本中实现为空函数。 |
save |
string |
Save the file received by command “send” to the file specified 保存通过“send”命令发送的问题件,文件名有参数决定 |
pipe |
string |
Execute shell command and read data from stdio pipe IN. mfg will send file to stdio pipe OUT. 执行shell命令并且从标准IO管道IN中读入数据,Mfg往标准管道OUT中发送数据 这对于那些数据大小大于内存的数据传输非常有用。 Note: The above two commands must be combined to use 注意:以上2条命令必须配合使用 Recommend: Please add below command prior to pipe command to free some memory. 建议:请添加下面这条命令在pipe命令之前,主要是为了释放一些内存。 <CMD type="push" body="$ echo 3 > /proc/sys/vm/drop_caches">release memory</CMD> |
wff |
NONE |
Deprecate(该方法不建议使用) |
wfs |
NONE |
Deprecate(该方法不建议使用) |
ffs |
NONE |
Write firmware to SD. 将固件写入SD卡中 |
wrf |
NONE, |
ubiformat nand with ubi image. 采用ubi文件系统格式化nand,并写入ubi image |
wrs |
number of sd partition |
Write rootfs image to sd card. 写入rootfs image 到sd卡中 |
frf |
NONE |
same as flush |
frs |
NONE |
same as flush |
2.2.2.1 OTP Bits Programming(OTP位编程)
Command below shows how to write a file to a disk:
下面展示了如何写一个文件到磁盘中
1 <CMD state="Updater" type="push" body="$ ls /sys/fsl_otp ">Showing HW_OCOTP fuse bank</CMD> 2 <CMD state="Updater" type="push" body="$ echo 0x11223344 > /sys/fsl_otp/HW_OCOTP_MAC0">write 0x11223344 to HW_OCOTP_MAC0 fuse bank</CMD> 3 <CMD state="Updater" type="push" body="$ cat /sys/fsl_otp/HW_OCOTP_MAC0">Read value from HW_OCOTP_MAC0 fuse bank</CMD>
The fuse bank name (ex: HW_OCOTP_MAC0) should be set as needed.