这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » nand flash调试问题请教?

共5条 1/1 1 跳转至

nand flash调试问题请教?

菜鸟
2007-01-21 23:17:15     打赏

CPU::AT91RM9200
SDRAM: 2*16M HY57V281620HG 0x20000000
Nor Flash:4M AT49BV322A 0x10000000
Nand Flash: K9F1208U 0x40000000
调试环境:tornado 2.2
目前,从外部nor flash启动下载vxworks后,能够identify成功,并且MTD驱动程序,都已经调试过没有问题。
FTL使用:
#define INCLUDE_TL_NFTL
包含了basic mmu

问题1:
在shell下,调用tffsDevFormat进行格式化的时候,出现错误:
Instruction prefetch abort

Exception address: 0xda000014
Current Processor Status Register: 0x60000013

Data abort
Exception address: 0x201a7448
Current Processor Status Register: 0x60000013
Task: 0x21f29dc0 "tShell"


问题2:
有时候在调用tffsShow时会出现异常:
communication failed with error -1
查找代码,发现是因为tffsRawio函数不成功导致,这个函数是干什么用的?
大家帮忙分析一下,另外有个疑问,nand flash的坏块在使用过程中会不会增加,感觉使用nand flash存储数据的可靠性不够高,大家是什么观点?




关键词: flash     调试     问题     请教    

院士
2007-01-22 00:34:00     打赏
2楼

等着woodhead吧~

周一


菜鸟
2007-01-22 18:23:00     打赏
3楼

第一个问题,出了一堆的指令数据异常,是不是访问了非法地址?我也搞不清楚。只能给出一些通常用法的建议。从nand类型的flash做tffs的时候需要注意以下几点:

1、read函数一定要在identify的时候注册,因为nand类型的flash不能直接读取;

2、map函数不能像nor一样直接映射,需要开辟一个全局的buf,把flash里面的内容使用read函数读到buf里面,再把buf地址返回;

3、write函数的overwrite选项一定要处理,会操作到每个block后面的几个字节,这里要记录状态;

4、全局变量tlTable表里面,可能没有nftl的格式化和mount函数,如果没有自己添加;

第二个问题,tffsRawio是low level的ioctrl,以下是这个函数的几个io选项的处理:

* TFFS_GET_PHYSICAL_INFO writes the flash type, erasable block size, and media
* size to the user buffer specified in <arg0>.
*
* TFFS_PHYSICAL_READ reads <arg1> bytes from <arg0> and writes them to
* the buffer specified by <arg2>.
*
* TFFS_PHYSICAL_WRITE copies <arg1> bytes from the <arg2> buffer and writes
* them to the flash memory location specified by <arg0>.
* This aborts if the volume is already mounted to prevent the versions of
* translation data in memory and in flash from going out of synchronization.
*
* TFFS_PHYSICAL_ERASE erases <arg1> erase units, starting at the erase unit
* specified in <arg0>.
* This aborts if the volume is already mounted to prevent the versions of
* translation data in memory and in flash from going out of synchronization.
*
* TFFS_ABS_READ reads <arg1> sectors, starting at sector <arg0>, and writes
* them to the user buffer specified in <arg2>.
*
* TFFS_ABS_WRITE takes data from the <arg2> user buffer and writes <arg1>
* sectors of it to the flash location starting at sector <arg0>.
*
* TFFS_ABS_DELETE deletes <arg1> sectors of data starting at sector <arg0>.
*
* TFFS_DEFRAGMENT_VOLUME calls the defragmentation routine with the minimum
* number of sectors to be reclaimed, <arg0>, and writes the actual number
* reclaimed in the user buffer by <arg1>. Calling this function through some
* low priority task will make writes more deterministic.
* No validation is done of the user specified address fields, so the functions
* assume they are writable. If the address is invalid, you could see bus errors
* or segmentation faults.


菜鸟
2007-01-22 21:59:00     打赏
4楼

请教woodhead:

2、map函数不能像nor一样直接映射,需要开辟一个全局的buf,把flash里面的内容使用read函数读到buf里面,再把buf地址返回;

3、write函数的overwrite选项一定要处理,会操作到每个block后面的几个字节,这里要记录状态;

?1 map函数是在什么时候调用的,在nand flash的tffs中read操作是怎么工作的?

?2 读模式是需要设置为overwrite么,操作block后面的字节是什么意思,是flash的内部寄存器么?

谢谢,woodhead,关于tffsRawio的问题,我再仔细调下!


菜鸟
2007-02-04 06:38:00     打赏
5楼
nand 从来就不保证没坏块,出现坏块由文件系统来自己解决

共5条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]