在线时间5 小时
UID3057030
注册时间2014-9-1
NXP金币0
该用户从未签到
新手上路

- 积分
- 19
- 最后登录
- 2014-9-5
|

楼主 |
发表于 2014-9-2 17:13:04
|
显示全部楼层
因为我手头上的软件也是从别人拿过来的,找了下整个目录没有看到什么样板ucl.xml,原来的烧录功能都是没有什么问题的,只是这次想加个烧序列号的功能。另外,关于这个功能也是参考Document下的[Manufacturing Tool UCL user manual.doc]文档作的。
------------------------------
1.2.1.5 Log command
To burn unique data like product serial number, MAC address, key, etc, log command can be used. There are a bunch of commands needed to finish the task.
A user should create a .ini format file which is the source accessed by log commands. A typical file’s content is listed as below:
[No]
START=0x0
END=0x1000
[SN]
START=0x1000
END=0x2000
[YYXX]
START=0x100
END=0x2000
[CurrentUsing]
No=0x0
SN=0x1000
YYXX=0x100
In this example, No, SN and YYXX are called key words which mean the key has a value range defined between “START” and “END”. You can define whatever name you want for the key words.
Note: “Start” and “END” is reserved words to define the range, you can NOT change the definition.
Note: the range is [START, END). For example, [0, 100) means 0, 1, 2…99 are valid values, but 100 is not included.
CurrentUsing is not a key word since it hasn’t a range, but a record in which all key words’ current value are recorded.
Below commands are used to burn the unique data to a device.
<CMD type="log" body="readRange: section=No, section=SN, section=YYXX," file="UIDStore.ini">read the range of UID to host buffer</CMD>
<CMD type="log" body="readValue: section=CurrentUsing, key=No, key=SN, key=YYXX," file="UIDStore.ini">read the latest UID to host buffer</CMD>
<CMD type="log" body="write: section=CurrentUsing, $(No)+=1, $(YYXX)+=1," file="UIDStore.ini">write the latest UID to host buffer</CMD>
<CMD type="push" body="GenNewUID ProductID=$(SN) YYXX=$(YYXX)">write the UID to device</CMD>
The meaning of above commands are very easy to understand.
Command 1 informs the range of all key words. “section” and “readRange” are reserved words which can’t be changed, but one can replace words like “No”, “SN”, to whatever he/she wants. The file name “UIDStroe.ini” can also be self-defined to whatever he/she wants. It is suggested to store the file in the same folder where ucl.xml locates to eliminate the need of path index like “../Myfolder/UIDStroe.ini”
Commands 2 read key words current value into internal buffer of Mfgtool.
Command 3 writes next value of key words into UIDStore.ini. Only “+=” operator is supported till now.
Command 4 writes the value to device. $(SN) means it is a macro which should be replaced by current value. The command’s body contains “GenNewUID”, which is the name of a user-defined firmware command since only the customer knows how to deal with the data. Users can define whatever name they want, like “WriteMacAddr”, “WriteSN”, and so on, and implement the firmware command in their devices.
------------------------------
请问使用这个功能和变量还需要什么前提设定吗?如果有样例ucl.xml可以参考的话,不胜感激! |
|