Flash erase/program 检查方法
来源:互联网 发布:sql 查询过期时间 编辑:程序博客网 时间:2024/05/17 21:50
有两种方法Data polling 和Toggle bit
- Data Polling
在erase/programcmd写下去之后,Q7位会变成data取反(因为erase后是0xff,所以这时Q7=0),然后直到erase/program操作结束,Q7才会变成实际的data。也就是flash进入普通的read模式。所以我们在写driver时,是可以使用 erase:while(*addr==0xff); program: while(*addr==data); 这样的方法来等待操作结束的。 - Toggle Bit
在erase/program cmd写下去之后, Q6位在连续的两次读操作中,读出的数据会相反,直到erase/program操作结束.参考这样一段代码
int FlashDataToggle( void )
{
volatile FLASH_DEF u1, u2; /* hold values read from any address offset within
the Flash Memory */
volatile FLASH_DEF * pFA;
while( 1 ) /* TimeOut!: If, for some reason, the hardware fails then this
loop may not exit. Use a timer function to implement a timeout
from the loop. */
{
/* Step 1: Read DQ6 (into a word) */
pFA = FLASH_CAST(FLASH_ADRS); /* Read DQ6 from the Flash (any address) */
u1 = *pFA;
/* Step 2: Read DQ5 and DQ6 (into another word) */
u2 = *pFA; //FlashRead( ANY_ADDR ); /* Read DQ5 and DQ6 from the Flash (any
/* Step 3: If DQ6 did not toggle between the two reads then return
FLASH_SUCCESS */
if( (u1&0x40) == (u2&0x40) ) /* DQ6 == NO Toggle */
return FLASH_SUCCESS;
/* Step 4: Else if DQ5 is zero then operation is not yet complete */
if( (u2&0x20) == 0x00 )
continue;
/* Step 5: Else (DQ5 == 1), read DQ6 again */
u1 = *pFA; //FlashRead( ANY_ADDR ); /* Read DQ6 from the Flash (any address) */
u2 = *pFA; //FlashRead( ANY_ADDR ); /* Read DQ6 from the Flash (any address) */
/* Step 6: If DQ6 did not toggle between the last two reads then
return FLASH_SUCCESS */
if( (u2&0x40) == (u1&0x40) ) /* DQ6 == NO Toggle */
return FLASH_SUCCESS;
/* Step 7: Else return FLASH_TOGGLE_FAIL */
else { /* DQ6 == Toggle here means fail */
return FLASH_TOGGLE_FAIL;
}
} /* end of while loop */
}
上一篇:Ramdisk的做法
下一篇:X31从ubuntu 6.06升级到7.10
- 双机热备Oracle数据库服务器操...
- 双机热备Oracle数据库服务器操...
- 双机热备Oracle数据库服务器操...
- 虚拟磁带库的新生
- 虚拟磁带库的新生(1)
- Flash erase/program 检查方法
- nand flash read/program/erase
- Lifetime Improvement of NAND Flash-based Storage Systems Using Dynamic Program and Erase Scaling
- FLASH ERASE:CHIP、BLOCK、SECTOR
- erase方法+erase(lob,amount,offset)+使用erase方法
- 【STL中的erase()方法 】
- string的erase方法
- C++中的erase方法
- nand flash erase 函数调用流程
- Program E的Flash前端
- erase方法的正确使用
- string 的erase方法注意事项
- c++string的erase方法
- stl.list正确erase方法
- erase
- erase
- erase()
- erase
- RecyclerView的常见用法总结
- 关于Spring Data redis几种对象序列化的比较
- Maven+mybatis+mysql项目实践(附demo)
- git命令之git fetch的用法
- Cache在Driver中的使用简介
- Flash erase/program 检查方法
- 计蒜客 query on a string
- kuangbin KMP E题
- UrJTAG 使用和扩展
- Test5
- java线程同步机制以及对象锁机制
- 使用RecyclerView实现ListView,GridView的效果(上下,左右滑动),拖拽与滑动删除
- 思维导图的三招十八式之梳理
- linux文件描述符限制和单机最大长连接数