现在的位置: 首页 > 综合 > 正文

如何在codewarrior中的flashprogrammer添加新的flash型号

2012年04月05日 ⁄ 综合 ⁄ 共 2316字 ⁄ 字号 评论关闭

        由于项目需要节约成本,更新硬件,主要包括PPC MPC5125处理器、DDR2内存以及Norflash。林工希望换掉老的spansion S29GL128P, 更新为速度更快、容量更大的spansion 65 nm  S29GL256S,但在硬件设计初期发现之前使用的flash烧写工具flashprogrammer并不支持该款新的flash,所有硬件做好了都得让我调试,解决这个问题的任务自然推到我这里。于是下载手册看其区别,其实改动很小,但为了确定还是给freescale的技术支持打电话询问。我的freescale支持很热心,但俨然不够专业,甚至连自己公司有哪些技术文档都不知道。当然freescale的技术文档浩如烟海,也不能怪他。打了好几次电话只让我去找第三方软件,实在不靠谱,只好设法联系spansion的技术支持。在网上搜了半天,发现在其官网可以发邮件咨询任何问题,其效率之高让我十分佩服。回答简明扼要,一是贴了一个新老版本flash的附件,几乎把软硬件上的设计差别都讲清楚了,二是关于烧写软件的问题,一句话就是让freescale去更新codewarrior,于是陷入死胡同。一边给了方法,一边说软件算法部分是由第三方做的,不提供更新,实在让我很头疼。

       过了几天,在网上搜到一篇freescale的技术文档“Adding Flash Devices to the EPPC Flash Programmer”,让我顿时很兴奋,又后悔当时没有认真在官网上找这篇文章。打开一看,正是我要找的内容,按照以下方法在EEPC\FPdeviceConfig.xml中新定义了S29GL256S。

To add Flash programming support for a new Flash device:
1. Locate the data sheet for the new device.
2. Examine the installed FPDeviceConfig.xml file for the most similar definition.
3. Copy and edit the definition to make it conform to the new device.
Before you can add a new entry to this file you need to know the following about your Flash device:
> Device name
> Manufacturer ID code
> Device ID codes (8-bit, 16-bit)
> Number of sectors
> Starting and ending address for each sector
> Can the device be chip-erased
> Options for data bits per device (8-bits, 16-bits)
> Number of Flash devices on your target
> What device is most similar in the FPDeviceConfig.xml file

     具体区别还得看芯片手册,这个用XML语言写的配置文件修改起来很方便,添加如下定义

 <comment>
#######################################################################
</comment>
</device>
<device>
   <name>S29GL256S</name>
   <manufacturerid>01</manufacturerid>
   <chiperase>TRUE</chiperase>
   <sectorcount>256</sectorcount>
   <sectorstart>00000000</sectorstart>
   <sectorend>0001FFFF</sectorend>
   <sectorstart>00020000</sectorstart>
   <sectorend>0003FFFF</sectorend>

.......
   <sectorstart>01FE0000</sectorstart>
   <sectorend>01FFFFFF</sectorend>
   <organizationcount>3</organizationcount>
   <organization>16Mx16x1</organization>
   <organization>16Mx16x2</organization>
   <organization>16Mx16x4</organization>
   <id>227E</id>
   <id>227E</id>
   <id>227E</id>
   <algorithm>amd16x1.elf</algorithm>
   <algorithm>amd16x2.elf</algorithm>
   <algorithm>amd16x4.elf</algorithm> 
       其实之前一直担心算法不会不一样,看了所有flash的算法后,发现大部分都是一样的,甚至相近的都可以通用。该文档还介绍了使用perl语言来插入一个falsh entry,由于比较复杂就不在说明。

      第一次使用XML语言和Perl语言,发现这种标志语言与之前QNX中使用的buildfile命令、linux提示符命令有很大相同之处。记得之前做一个使用SD卡做STM32配置文件的项目,想到了类似的方法,当时还不知道这些描述语言,就自己写了一个可识别许多标志很信息的脚本,感觉很好用,现在才知道有这种规范。

抱歉!评论已关闭.