嵌入式 uboot的nand flash常用命令
来源:互联网 发布:明略数据校园招聘 编辑:程序博客网 时间:2024/04/28 04:30
nand info & nand device
显示flash的信息:
DM365 :>nand infoDevice 0: NAND 32MiB 3,3V 8-bit, sector size 16 KiBDM365 :>nand deviceDevice 0: NAND 32MiB 3,3V 8-bit
nand read(.oob) addr off size
不管是读取data, 使用nand read,还是读取oob,使用命令nand read.oob, 后面跟的地址addr,都是ram的地址, off指的是nand flash的地址, size:指要读取nand flash的数据大小, 但是如果是读取oob, size不能超过一个page的oob size, 如果page size为512个字节, oob size就是16个字节.
DM365 :>nand read 86000000 58000 100NAND read: device 0 offset 0x58000, size 0x100 256 bytes read: OKDM365 :>md 86000000 4086000000: ea000012 e59ff014 e59ff014 e59ff014 ................ …………860000f0: e1a0000d eb00022e 00000000 00000000 ................
DM365 :>nand read.oob 86000000 58000 10NAND read: device 0 offset 0x58000, size 0x10 16 bytes read: OKDM365 :>md 86000000 40 86000000: ffffffff 2707ffff 33e316ad 44b2e1a1 .......'...3...D
如果一次想读取完整的一个page 的值,包含oob, 使用下面将的命令, nand dump.
nand dump [addr] [size]
调用过程: nand dump addr size (common/cmd_nand.c)==> nand_dump() ==> nand_read_raw();
nand dump 不管你的size有多大,至少会dump出一个page的大小:
SMDK2440 # nand dump 0 100Page 00000000 dump: 12 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 00 02 f8 33 60 02 f8 33 c0 02 f8 33 20 03 f8 33 80 03 f8 33 e0 03 f8 33 40 04 f8 33 ef be ad de 00 00 f8 33 00 00 f8 33 58 19 fa 33 34 6d fa 33 00 00 0f e1 1f 00 c0 e3 d3 00 80 e3 00 f0 29 e1 ………… 04 30 8c e5 fc 4d 00 eb 00 01 9f e5 f0 3c 00 eb 02 0d 00 eb 41 42 00 eb f4 00 9f e5 00 40 98 e5 04 02 00 eb 0d 10 a0 e1 04 00 84 e5 40 20 a0 e3OOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 69 a6 ab 3c 33 cf 66 5a a7 cf f0 33 a6 96 97 3f 0c c3 30 30 c3 cc 33 f3
nand write - addr off size
这个命令和nand read一样, 只是方向是反的, 是把ram的值写到 nand flash中, 但是这个写只能将1改为0, 不能将0写成1. 这个command会自动skipping bad blocks。
nand erase [clean] [off size]
在擦之前会先check是不是坏块,如果是坏块,就不能做擦的动作了。
DM365 :>nand dump 1cc000 10Page 001cc000 dump: 68 73 71 73 12 05 00 00 87 04 08 78 19 00 40 02 ………… df 88 5b 80 bb 11 32 11 6e e7 77 5a 3d b9 c8 bfOOB: ff ff ff ff ff ff ff 45 ed cc 3a e0 8e 52 f9 ad
DM365 :>nand erase 1cc000 100NAND erase: device 0 offset 0x1cc000, size 0x100Warning: Erase size 0x00000100 smaller than one erase block 0x00004000 Erasing 0x00004000 insteadErasing at 0x1cc000 -- 100% complete.OK
DM365 :>nand dump 1cc000 10 Page 001cc000 dump: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ………… ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffOOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
DM365 :>mw 86000000 00000000DM365 :>mw 86000004 00000000DM365 :>mw 86000008 00000000DM365 :>mw 8600000c 00000000DM365 :>md 86000000 86000000: 00000000 00000000 00000000 00000000 ................
DM365 :>nand write.oob 86000000 1cc000 10NAND write: device 0 offset 0x1cc000, size 0x10 16 bytes written: OK
DM365 :>nand dump 1cc000 10 Page 001cc000 dump: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ………… ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffOOB: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
DM365 :>nand erase 1cc000 100NAND erase: device 0 offset 0x1cc000, size 0x100Warning: Erase size 0x00000100 smaller than one erase block 0x00004000 Erasing 0x00004000 insteadSkipping bad block at 0x001cc000 OK
不常用的命令
这些命令都是测试时使用的,正常是不会使用到的。
"nand scrub - really clean NAND erasing bad blocks (UNSAFE)\n" "nand markbad off - mark bad block at offset (UNSAFE)\n" "nand biterr off - make a bit error at offset (UNSAFE)\n" "nand lock [tight] [status]\n" " bring nand to lock state or display locked pages\n" "nand unlock [offset] [size] - unlock section\n");
0 0
- 嵌入式 uboot的nand flash常用命令
- uboot的nand flash常用命令
- uboot下的nand flash驱动分析
- 从Nand flash启动的uboot
- nand flash uboot 启动
- 嵌入式--Nand Flash存储
- linux nand flash常用命令
- linux nand flash常用命令
- linux nand flash常用命令
- NAND Flash--嵌入式NAND Flash读写技术
- NAND Flash--嵌入式NAND Flash读写技术
- NAND Flash--嵌入式NAND Flash读写技术
- Nand flash uboot 命令详解
- Nand flash uboot 命令详解
- Nand flash uboot 驱动研究
- Nand flash uboot 命令详解
- Nand flash uboot 命令详解
- Nand flash uboot 驱动研究
- HTML小结
- 11
- 嵌入式 网口以及串口操作小结
- Morris Traversal 遍历二叉树
- 用json获取服务器端的数据
- 嵌入式 uboot的nand flash常用命令
- OCP 1Z0 052 123
- 自由职业,我的半年总结
- linux 文件链接
- IOS7 隐藏状态栏 (电池栏 )
- 6.Swift教程翻译系列——Swift集合类型
- LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏——引用大神终极解决方案
- 数据结构+算法系列四:I 堆排序
- 2014第一帖