ubiformat and nandwrite

轉載自http://www.linux-mtd.infradead.org/faq/ubifs.html

 

Why do I have to use ubiformat?

The first obvious reason is that ubiformat preserves erase counters, so you do not lose your wear-leveling information when flashing new images.

The other reason is more subtle, and specific to NAND flashes which have ECC calculation algorithm which produces ECC code not equivalent to all 0xFF bytes if the NAND page contains only 0xFF bytes. Consider an example.

  • We erase whole flash, so everything is 0xFF'ed now.
  • We write an UBI/UBIFS image to flash using nandwrite.
  • Some eraseblocks in the UBIFS image may contain several empty NAND pages at the end, and UBIFS will write to them when it is run.
  • The nandwrite utility writes whole image, and it explicitly writes 0xFF bytes to those NAND pages.
  • The ECC checksums are calculated for these 0xFF'ed NAND pages and are stored in the OOB area. The ECC codes are not 0xFF'ed. This is often the case for HW ECC calculation engines, and it is difficult to fix this. Normally, ECC codes should be 0xFF'ed for such pages.
  • When later UBIFS runs, it writes data to these NAND pages, which means that a new ECC code is calculated, and written on top of the existing one (unsuccessfully, of course). This may trigger an error straight away, but usually at this point no error is triggered.
  • At some point UBIFS is trying to read from these pages, and gets and an ECC error (-EBADMSG = -74).

In fewer words, ubiformat makes sure that every NAND page is written once and only once after the erasure. If you use nandwrite, some pages are written twice - once bynandwrite, and once by UBIFS.

If you can not use ubiformat, an alternative is to set the "free space fixup" flag when generating the UBIFS image (see here).

What is the the purpose of the -F (--space-fixup) mkfs.ubifs option?

Because of subtle ECC errors that can arise when programming NAND flash (see here), ubiformat is the recommended way of flashing a UBI image which contains a UBIFS file system. However, this is not always possible - for example, some embedded devices are manufactured using an industrial NAND flash programmer which has no knowledge of UBI or UBIFS.

The -F option causes mkfs.ubifs to set a special flag in the superblock, which triggers a "free space fixup" procedure in the kernel the very first time the filesystem is mounted. This fixup procedure involves finding all empty pages in the UBIFS file system and re-erasing them. This ensures that NAND pages which contain all 0xFF data get fully erased, which removes any problematic non-0xFF data from their OOB areas.

Of course it is not possible to re-erase individual NAND pages, and entire PEBs are erased. UBIFS performs this procedure by reading the useful (non 0xFF'ed) contents of LEBs and then invoking the atomic LEB change UBI operation. Obviously, this means that UBIFS has to read and write a lot of LEBs which takes time. But this happens only once, and the "free space fixup" procedure then unsets the "fixup" UBIFS superblock flag.

This option is supported if you are running a kernel version 3.0 or higher, or if you have pulled the changes from a UBIFS back-port tree. Note that ubiformat is still the preferred flashing method if the image is not being flashed for the first time, since it preserves existing erase counters (while using nandwrite or its equivalent does not).

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: c6748_nandwrite.out是一个文件,它是用于在c6748开发板上进行NAND闪存写入操作的工具。这个文件可以通过下载来获取。 要下载c6748_nandwrite.out,你需要首先确定你要从哪个来源获取该文件。通常,这个文件可以从相关的开发板制造商的官方网站、开发者社区或者其他可信赖的软件资源网站上找到。 一旦你找到了可靠的来源,你可以按照以下步骤来下载c6748_nandwrite.out: 1. 在你的计算机的网页浏览器中打开下载来源的网站。 2. 寻找一个搜索栏或者下载或软件页面,通常它们会提供一个搜索栏或者一些分类选项来帮助你找到所需的文件。 3. 输入“c6748_nandwrite.out”进行搜索,或者根据相关的分类进行浏览。 4. 一旦找到了目标文件,请点击下载按钮或者链接来开始下载过程。 5. 你的浏览器会开始下载c6748_nandwrite.out文件,并且将其保存到你的计算机指定的位置。 下载的速度取决于你的网络连接状况和文件的大小。当下载完成后,你可以进入文件的保存位置,查看该文件是否已成功下载。 值得一提的是,在下载和使用任何软件之前,请确保你从信任的来源获取该文件,并检查文件是否有病毒或其他恶意内容。同时,你也需要确保该软件适用于你的设备和使用场景。 ### 回答2: c6748_nandwrite.out 是一个用于下载的文件。该文件的后缀名 ".out" 通常表示可执行二进制文件。c6748_nandwrite是一个程序或工具,用于将数据写入 NAND Flash 存储设备中。 要下载 c6748_nandwrite.out,您可以按照以下步骤进行操作: 1. 在您使用的计算机上打开一个网页浏览器,比如Google Chrome、火狐浏览器等。 2. 在浏览器的搜索引擎栏中输入 "c6748_nandwrite.out 下载",并按下回车键。 3. 在搜索结果中,找到一个可靠的来源或官方网站,从中下载该文件。推荐下载来自官方来源或受信任的网站,以确保文件的完整性和安全性。 4. 点击下载链接,浏览器将开始下载该文件。文件的大小可能会影响下载时间。 5. 一旦下载完成,您可以在计算机的下载文件夹或您选择的默认文件夹中找到该文件。 6. 您可以在文件管理器中双击该文件,即可运行或安装 c6748_nandwrite.out。如果该文件是可运行的,它可能会执行某些操作或弹出一个操作界面。 需要注意的是,在下载和运行任何文件之前,您应该时刻保持计算机的安全。确保您的计算机已安装防病毒软件,并仅从可信任的来源下载文件,以避免不必要的风险。 ### 回答3: c6748_nandwrite.out是一个用于下载的文件,它是用于嵌入式系统 c6748芯片的一种特定应用程序。这个程序的功能是将数据写入到嵌入式系统的NAND闪存设备中。 NAND闪存是一种非易失性存储器,常用于嵌入式系统中作为主要的存储介质。c6748_nandwrite.out程序可以通过与c6748系统的串行接口通信,并将指定的数据写入到系统的NAND闪存中。 用户可以通过下载c6748_nandwrite.out程序来获取该应用程序的源代码或者可执行文件。具体下载操作可以选择通过互联网或其他可用的数据传输方式来进行。 下载后,用户可以将c6748_nandwrite.out程序加载到嵌入式系统的c6748芯片中,并通过操作系统运行该程序,实现将数据写入到NAND闪存的功能。 总结来说,c6748_nandwrite.out是用于下载并运行在c6748芯片上的一种应用程序,它实现了将数据写入到NAND闪存的功能。用户可以通过下载该程序并按照相关指引来使用它,以满足自己的需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值