我的WINCE4.2历程(13)

1)根本就没有焊的RTC4513

上周五见到了当初做手上这块板子的牛人,当时牛人问我WINCE移植的怎么样了,我告诉他触摸屏有反应但是还没有校准完成另外那个RTC4513读出来的日期始终是一个固定的错误值。牛人当时就乐了,“RTC4513根本就没有焊啊”。我那个震惊啊,回想起前段时间为了调RTC413我花了一个星期把BSP差不多都折腾了个底朝天,最后头都要吐血了还是没搞定,居然是这么个原因,不由感叹,哎,我那无辜逝去的青春啊。

2)应用程序数据保存位置的考虑。

目前的三种方案可供选择

2.1)方案一:应用程序数据保存在NOR FLASH中

优点:不用再增加额外的硬件了

缺点:NOR FLASH写入寿命有限,不注意容易写坏FLASH。FAT文件系统写入中掉电容易造成系统不一致进而系统无法启动。

2.2)方案二:应用程序数据保存在SD卡中

优点:接口硬件简单;目前的SD卡中集成的控制器考虑了写入平衡问题;

缺点:有前辈认为SD卡不适合工业应用;拆解某流行工控屏发现,虽然留有SD卡接口但是并未焊接。

2.3)方案三:应用程序数据保存在CF卡中

优点:工业应用广泛。目前的CF卡中集成的控制器考虑了写入平衡问题;

缺点:接口PIN数较多,驱动较为复杂。

3)针对方案一的GOOGLE

针对方案一,我搜索的文章最多。从搜索到的文章来看,WINCE4.2下NOR FLASH上的文件系统确实是个头疼的问题。网上搜索的结果表明采用方案一出问题的人还是不少的,但是回复中也有很多人表示自己采用方案一也没有出现什么问题。以下是一些比较有价值的文章:

--------------------------------------------------------------------------------

遇到问题的兄弟们

http://topic.csdn.net/u/20091224/13/8b5c0a50-ff06-4e98-afaf-624f5851de27.html

ATMEL at91sam9261,操作系统Wince5.0,256M的三星K9F2G08闪存,系统用了32M,其他是NandFlash文件系统,BSP用的是ATMEL官网公布的BSP。
一般情况下向NandFlash中读写文件都是正常的,但是长时间连续(大约一个多月,每10分钟大约写1M的文件,存储到100多M时会删除部分数据)多次写文件,删除文件重启后,NandFlash就不能写入了,一写入就会死机,读文件还都是正常的,看调试信息,发现逻辑0块被标记为坏块,擦除闪存后可恢复正常,而且逻辑0块可以擦除恢复正常。
各位兄弟有没有遇到类似问题的,出问题的原因可能有哪些呢?麻烦帮忙分析分析。

 

nandflash 频繁写的话,问题还真是比较多
wince里面,坏块管理和负载均衡的算法都是PB自带,ms提供的,BSP里面只要实现物理读写flash的函数就行了
按道理来说不应该有什么问题
可是我们也碰到过类似LZ的问题.因为我们那个项目的数据量比较小,但是读写频繁,后来就干脆存放在e2prom里面了.
没有去深究这个问题的真正原因.
猜测和异常断电这类的原因有关???
希望有高手来指点下.
而且我一直不太明白,三星的FMD驱动为什么要把每个block的page数强制设置成256
#define PAGES_PER_BLOCK 256 // Phisical 64 * logical 4
这样小页的flash需要用8个block来模拟一个大的block,不是严重影响写nand的性能.
对于大页的flash就没有什么问题
难道这么做就是为了兼容,不过现在小页的flash确实用的越来越少了.

--------------------------------------------------------------------------------

WINCE 4.2的FAL层(flash abstraction layer)中是考虑了写平衡(wear leveling)的

http://blog.csdn.net/gooogleman/archive/2008/11/19/3335766.aspx

由于WinCE对FAT文件系统读写实现了wear-leveling(磨损均衡)机制,fat table等常进行写入
的区域被WinCE的FAL层算法均衡的写在flash的不同区域,而不是同一位置反复刷写。而这种
wear-leveling算法微软并未公开,故很难将这种机制模拟的一模一样。

----------------------------------------------------------------------------------------------

写平衡是性能优化的副产品?

http://us.generation-nt.com/answer/wear-leveling-support-nor-flash-wince-6-0-help-120539741.html

If your block driver links with FAL.lib you should be OK, and you're
probably OK even if it dosn't. In fact, wear leveling comes as a side
effect of the sector write speed optimization algoritms that you
pretty much need to have in place in order to get decent modify/write
performance out of flash devices. Rather than waiting for a slow erase
operation to finish the modified data is instead moved to a fresh
sector and the old sector is then erased in a background operation.
This functionality is implemented by FAL.
Henrik Viklund
Prevas AB

----------------------------------------------------------------------------------------------

最好不要在NOR FLASH上运行文件系统,因为它很慢

http://www.pocketpcjunkies.com/Uwe/Forum.aspx/wince-dev/5788/FAT-Corruption-in-WinCE-Device-NOR-FLash

The information you got from MOXA that the file system is corrupting because
of WinCE FAT not necessarily 100% true. In our system we are using NAND flash
and NOR flash. We have done various power failures testing in our device with
NAND flash but we could not find this issue. 
However we have data corruption issue for other reason but we have manage to
fix it.
I have few suggestions for you.
•NOR flash is much slower in writing data than other device like NAND flash.
So whenever you write to file system it takes long time to complete the
writing process. If any power failure happen in the middle writing process,
almost certain to have data corruption issue.
SLOWER DEVICE IS (WHEN USE AS A FILE SYSTEM) ALWAYS PRON TO POWER FAILURE
ISSUE. We have tested several device like NOR, ORNAND etc. have power failure
issue. Manageable but Needed lots of driver fine tuning; the manufacturer
driver provided with chip is not design for windowCE.
•Use proper shutdown method similar to PC (WindowCE also provide this
option) instead of direct power off. Provide uninterrupted power supply.
•Avoid NOR flash as file system device instead use NAND flash as file system
and NOR flash for only booting the system(Read only from NOR flash unless you
handle the power failure and slow writting process)
•Low level driver implementation is also critical for achieving data
reliability  in the NOR flash device. So you may use the third party file
system like.... Because WindowCE file system do lots of thing when you write
a data.
Good luck.

---------------------------------------------------------------------------------

4)目前的结论

就现有条件来看,也只能先评估方案一,如果出现问题再从方案二和方案三中选择吧。

5)目标板最终的硬件配置

这个还是就不要贴到BLOG上了,呵呵。

转载于:https://www.cnblogs.com/silentmj/archive/2010/05/10/1732004.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值