查看: 4478|回复: 9

[已解决] 【求助】mfgTool烧录序列号(已解决)

[复制链接]

该用户从未签到

1

主题

4

帖子

0

新手上路

Rank: 1

积分
19
最后登录
2014-9-5
发表于 2014-9-2 11:01:03 | 显示全部楼层 |阅读模式
本帖最后由 FSL_TICS_Rita 于 2014-10-9 17:59 编辑

使用mfg1.6.2.048烧iMx28的板子,想给动态的给烧录得fw烧一个序列号,ucl.xml的相关设定如下:
----------------------------

    <CMD type="log" body="readRange: section=TID," file="UIDStore.ini">read the range of UID to host buffer</CMD>
    <CMD type="log" body="readValue: section=CurrentUsing, key=TID," file="UIDStore.ini">read the latest UID to host buffer</CMD>   
    <CMD type="log" body="write: section=CurrentUsing, $(TID)+=1," file="UIDStore.ini">write the latest UID to host buffer</CMD>
    <CMD type="push" body="$ echo $(TID) > /mnt/ubi0/var/config/terminalid">Burn terminal id at config</CMD>
    <CMD type="push" body="$ sync">sync</CMD>

----------------------------
在第4句的地方,$(TID) 的值好像总也传不过来,是空值。
如果我把$(TID)换为1000或者0x002D什么的,却可以正常设到文件里。另外,UIDStore.ini的内容也是每烧一次都正常能加1。
请哪位帅哥靓姐能帮帮忙!现在这里谢了!


我知道答案 目前已有9人回答
回复

使用道具 举报

该用户从未签到

145

主题

4926

帖子

0

金牌会员

Rank: 6Rank: 6

积分
9267
最后登录
1970-1-1
发表于 2014-9-2 11:06:16 | 显示全部楼层
楼主你好!
你的题,我会帮你转给我们的I.MX工程师,他查阅后会帮你解决,还请耐心等待下。
回复 支持 反对

使用道具 举报

该用户从未签到

1

主题

4

帖子

0

新手上路

Rank: 1

积分
19
最后登录
2014-9-5
 楼主| 发表于 2014-9-2 11:46:18 | 显示全部楼层
谢谢版主!等候专家的指导
回复 支持 反对

使用道具 举报

该用户从未签到

45

主题

2369

帖子

0

金牌会员

Rank: 6Rank: 6

积分
3275
最后登录
1970-1-1
发表于 2014-9-2 16:03:11 | 显示全部楼层
楼主你好,关于你要修改mfgtool中的脚本的话,建议你参考mfg1.6.2.048中的ucl.xml文件来修改。
回复 支持 反对

使用道具 举报

该用户从未签到

45

主题

2369

帖子

0

金牌会员

Rank: 6Rank: 6

积分
3275
最后登录
1970-1-1
发表于 2014-9-2 16:03:37 | 显示全部楼层
还有这里你要想给动态的给烧录得fw烧一个序列号,能否解释一下呢。
回复 支持 反对

使用道具 举报

该用户从未签到

1

主题

4

帖子

0

新手上路

Rank: 1

积分
19
最后登录
2014-9-5
 楼主| 发表于 2014-9-2 17:13:04 | 显示全部楼层
FSL_TICS_Rita 发表于 2014-9-2 16:03
楼主你好,关于你要修改mfgtool中的脚本的话,建议你参考mfg1.6.2.048中的ucl.xml文件来修改。 ...

因为我手头上的软件也是从别人拿过来的,找了下整个目录没有看到什么样板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可以参考的话,不胜感激!
回复 支持 反对

使用道具 举报

该用户从未签到

1

主题

4

帖子

0

新手上路

Rank: 1

积分
19
最后登录
2014-9-5
 楼主| 发表于 2014-9-2 17:22:09 | 显示全部楼层
FSL_TICS_Rita 发表于 2014-9-2 16:03
还有这里你要想给动态的给烧录得fw烧一个序列号,能否解释一下呢。

其实就是fw里运行的程序需要一个编号,1个板子1个号,不重复,所以就想在烧板子的时候,通过log command功能给一个数值顺序加1,再push到fw包里预设的一个文件里。
回复 支持 反对

使用道具 举报

该用户从未签到

45

主题

2369

帖子

0

金牌会员

Rank: 6Rank: 6

积分
3275
最后登录
1970-1-1
发表于 2014-9-5 11:07:01 | 显示全部楼层
znormal 发表于 2014-9-2 17:22
其实就是fw里运行的程序需要一个编号,1个板子1个号,不重复,所以就想在烧板子的时候,通过log command ...

楼主你好,这里你加烧写序列号,我不是很明白你的用意,可以详细解释一下吗?
回复 支持 反对

使用道具 举报

该用户从未签到

45

主题

2369

帖子

0

金牌会员

Rank: 6Rank: 6

积分
3275
最后登录
1970-1-1
发表于 2014-9-5 11:08:48 | 显示全部楼层
并且你板子上烧写的内容都一样的,我不是很明白你为什么还要加序列号?
回复 支持 反对

使用道具 举报

该用户从未签到

45

主题

2369

帖子

0

金牌会员

Rank: 6Rank: 6

积分
3275
最后登录
1970-1-1
发表于 2014-10-9 17:59:23 | 显示全部楼层
楼主你好,如果你问题没有解决的话,欢迎继续在这里讨论哈~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|恩智浦技术社区

GMT+8, 2025-7-20 23:58 , Processed in 0.102489 second(s), 30 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

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