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. malloc 与 free 图

  2. OOP 概述

    面向对象程序设计基于四个基本概念:数据抽象.封装.继承和动态绑定. 类的基本思想是数据抽象和封装. 1 数据抽象 数据抽象是一种依赖于接口和实现分离的编程技术.类的接口包括用户所能执行的操作:类的实现 ...

  3. C开发之----#if、#ifdef、#if defined之间的区别

    #if的使用说明 #if的后面接的是表达式 #if (MAX==10)||(MAX==20) code... #endif 它的作用是:如果(MAX==10)||(MAX==20)成立,那么编译器就会 ...

  4. 设计模式22---设计模式之解释器模式(Interpreter)(行为型)

    1.讲解解释器模式 1.1解释器模式定义 给定一个语言,定义它的文法的一种表示,并定义一个解释器,这个解释器使用该表示来解释语言中的句子. 1.2解释器模式要点 解析器:把描述客户端调用要求的表达式, ...

  5. Java SE 6 新特性: HTTP 增强--转

    概述 Java 语言从诞生的那天起,就非常注重网络编程方面的应用.随着互联网应用的飞速发展,Java 的基础类库也不断地对网络相关的 API 进行加强和扩展.在 Java SE 6 当中,围绕着 HT ...

  6. Entity Framework CodeFirst------使用CodeFirst方式建立数据库连接(一)

    本文分步演练介绍通过 Code First 开发建立新数据库.这个方案包括建立不存在的数据库(Code First 创建)或者空数据库(Code First 向它添加新表).借助 Code First ...

  7. RMQ 与 LCA-ST算法

    RMQ算法 区间求最值的算法,用区间动态规划(nlogn)预处理,查询O(1) http://blog.csdn.net/y990041769/article/details/38405063 (PO ...

  8. titlebar和actionbar上的按钮设置

    ---恢复内容开始--- Actionbar加按钮: 在res文件夹下新建menu文件夹(如果你没有),然后添加一个XML文件 <?xml version="1.0" enc ...

  9. @PostConstruct与@PreDestroy

    从Java EE 5规范开始,Servlet中增加了两个影响Servlet生命周期的注解(Annotion):@PostConstruct和@PreDestroy.这两个注解被用来修饰一个非静态的vo ...

  10. ASP.net MVC 多语言处理

    MVC多语言处理主要分两部分,一部分是Razor视图中的文字标签内容切换, 另一部分是javascript文件中的文标签内容切换.  这里分这两部分来说. View视图中的比较好做, 思路是使用资源文 ...