1 nand scrub

这个命令会擦除坏块信息,将坏块标识成好的,但此时这个坏块有潜在有危险,在特定条件下仍会造成数据的丢失,所以应该谨慎使用.

Run U-boot and then use the following commands to clean the NAND device.

  1. Run the command nand bad to generate a list of the blocks on the device that the driver believes to be bad. Keep a copy of this list—it will be used later to remark the bad blocks manually.

  2. For each of the bad blocks on the list, run: nand dump <block-number>

  3. If the output of the dump command looks like "real" data, then it is safe to assume that it is a good block. If the block is all zeros (both in-band and out-of-band) then it is very likely to be a genuinely bad block. Keep a record of all the blocks that are genuinely bad.

  4. Run nand scrub to erase ALL of the blocks on the NAND device. This will also set most of the bad blocks to "good".

  5. Run nand bad again to obtain a revised list of bad blocks. Compare this list with the list of "genuinely bad" blocks (that is, blocks containing all zeros), obtained at step 3.

  6. For each block on the "genuinely bad" list that is no longer marked as bad by nand bad, run nand markbad &lt;block-number&gt;

Simply running nand scrub without first identifying which blocks are genuinely bad (using nand bad and nand markbad commands, as described above) will silently convert soft bad blocks to false good blocks, which will cause unrecoverable problems with reading and writing data.

2 mtdparts

The mtdparts command offers an easy to use and powerful interface to define the contents of the environment variable of the same name that can be passed as boot argument to the Linux kernel:

=> help mtdparts
mtdparts
- list partition table
mtdparts delall
- delete all partitions
mtdparts del part-id
- delete partition (e.g. part-id = nand0,1)
mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]
- add partition
mtdparts default
- reset partition table to defaults

大家都知道nand flahs 是有坏块的,假设有两个分区P1(block0,block1),P2(block2,block3,)假设要写一个数据(大小为2block),则会写到P1的block0,block1上.

但此时,如果block1为坏块,则数据会写至block0,block2,跳过坏块block1,但此时数据横跨两个区.

为了避免这种情况,可以使用这个命令:mtdparts.此时uboot 会进行边界检查,上例这种情况数据只会写到block0中,不会写至block2中.

几个Uboot命令的更多相关文章

  1. 1.ok6410移植bootloader,移植u-boot,学习u-boot命令

    ok6410移植u-boot 既然是移植u-boot当然首先需要u-boot源码,这里的u-boot代码是由国嵌提供的. 一.配置编译u-boot A. 解压 u-boot 压缩文件 B. 进入解压生 ...

  2. U-Boot命令大全(功能参数及用法)

    U-Boot上电启动后,按任意键可以退出自动启动状态,进入命令行. U-Boot 2010.03 (Sep 25 2011 - 16:18:50)     DRAM: 64 MB     Flash: ...

  3. uboot命令分析+实现【转】

    转自:http://xouou.iteye.com/blog/2150061 先贴一个重要结构,位于uboot/include/command.h,这个结构代表每个uboot命令 struct cmd ...

  4. 编译u-boot命令和u-boot常用命令

    一.编译u-boot命令 1.配置开发板 #make TQ2440_config 2.编译 #make all 3.交叉编译器是crosstools_3.4.5_softfloat” 使用4.3.3版 ...

  5. bootargs中的环境变量说明和一些常用的uboot命令

    bootargs中的环境变量说明和一些常用的uboot命令 一些常见的uboot命令:Help [command]在屏幕上打印命令的说明Boom [addr]启动在内存储器的内核Tftpboot通过t ...

  6. Uboot mmc命令解析&NAND flash uboot命令详解

    转载:http://blog.csdn.net/simonjay2007/article/details/43198353 一:mmc的命令如下: 1:对mmc读操作 mmc read addr bl ...

  7. securecrt中进入uboot命令行时,出现无法键入任何指令的问题解决方法

    securecrt中进入uboot命令行时,出现无法键入任何指令的问题解决方法 可能出现以下几种情况 1.securecrt在创建连接时,忘记取消勾选流控: 2.usb转串口线坏了3.uboot有问题 ...

  8. uboot命令(1):mmc命令

    版权声明 更新:2017-06-07博主:LuckyAlan联系:liuwenvip163@163.com声明:吃水不忘挖井人,转载请注明出处! 1 文章介绍 今天在进行Android分区修改的时候发 ...

  9. Uboot命令U_BOOT_CMD分析

    其中U_BOOT_CMD命令格式如下: U_BOOT_CMD(name,maxargs,repeatable,command,"usage","help") 各 ...

  10. Uboot 命令行 介绍

    背景 基本上,本文转载自:<ARM板移植Linux系统启动(五)Uboot命令行> 上次说到uboot的启动方式,最后会使用autoboot(自主模式)尝试引导kernel,如果失败或者被 ...

随机推荐

  1. 使用fastjson前台报406的问题解决方法

    返回的json数据前台页面报406,而后台没有报错,下面为解决方法 <?xml version="1.0" encoding="UTF-8"?> & ...

  2. Web的鼠标拖动效果

    以前写过一个拖动效果的Demo,拖拽元素新位置的计算是放在拖拽元素的mousemove事件中进行的.计算效率差,而且效果不好.所以一直有想怎样才能做出jquery-ui那种顺滑的拖拽效果. 其实顺滑的 ...

  3. codevs 3044 矩形面积求并 (扫描线)

    /* 之前一直偷懒离散化+暴力做着题 今天搞一下扫描线 自己按照线段树的一般写法写的有些问题 因为不用于以前的区间sum so 题解搬运者23333 Orz~ 去掉了打标记的过程 同时更新区间的时候先 ...

  4. 关于jquery的 $("form").serialize()和 new FormData表单序列化

    $("form").serialize()和 new FormData($('#uploadForm')[0])都是序列化表单,实现表单的异步提交,但是二者有区别 首先,前者,只能 ...

  5. maclean-【性能调优】Oracle AWR报告指标全解析 学习笔记

    原文链接:http://www.askmaclean.com/archives/performance-tuning-oracle-awr.html AWR小技巧 手动执行一个快照: Exec dbm ...

  6. NSArray 跟 NSMutableArray 使用 区别

    NSArray 可变数组 一.NSArray是静态数组,创建后数组内容及长度不能再修改. 实例: //用arrayWithObjects初始化一个不可变的数组对象. //初始化的值之间使用逗号分开,以 ...

  7. java项目测试log4j

    .literal { background-color: #f2f2f2; border: 1px solid #cccccc; padding: 1px 3px 0; white-space: no ...

  8. 【CF39E】【博弈论】What Has Dirichlet Got to Do with That?

    Description You all know the Dirichlet principle, the point of which is that if n boxes have no less ...

  9. amf0解释一下

    就简单记录一下省了以后忘了,amf0其实就几种数据格式的网络传输格式,比如数字,字符串,这些格式在传输的时候他给单独序列化了一下,主要支持以下这些: #define AMF0_NUMBER ((uin ...

  10. Chrome调试(转)

    原文地址:http://blog.csdn.net/chenmoquan/article/details/44943245#comments 觉得写的很适合web开发的新手 Chrome 的开发者工具 ...