zoukankan      html  css  js  c++  java
  • MTD 工具使用

    1. mtd_debug

    # mtd_debug
    usage: mtd_debug info <device> mtd_debug read <device> <offset> <len> <dest-filename> mtd_debug write <device> <offset> <len> <source-filename> mtd_debug erase <device> <offset> <len>

    mtd_debug info

    可以查看 flash 类型、块大小及 mtd 分区总大小,大小以10进制显示,分区大小就是 len

    mtd_debug write

    把文件写入 mtd,offset 和 len 可以用十进制表示也可以用十六进制表示,十六进制要用 0x 作为前缀, len 要小于等于文件长度和 mtd 分区大小,写入之前要 erase mtd 分区

    mtd_debug read

    参数含义跟 mtd_debug write 用法差不多

    mtd_debug erase

    擦除 mtd 分区,参数含义跟前面的 mtd_debug write 也是差不多啦

    如:

    mtd_debug read /dev/mtd2 0x0 0x009000000 config.img

    2. flashcp

    # flashcp
    usage: flashcp [ -v | --verbose ] <filename> <device> flashcp -h | --help -h | --help Show this help message -v | --verbose Show progress reports <filename> File which you want to copy to flash <device> Flash device to write to (e.g. /dev/mtd0, /dev/mtd1, etc.)

    用来把 flash 镜像写入 mtd 分区,如

    flashcp -v rootfs.image /dev/mtd1

    该命令把 erase,write verify 一块完成了

    mtd_debug 和 flashcp 执行的时候 cpu 占用率比较高,会导致系统响应缓慢甚至假死机,耐心等待就好了

    dd 时候不要使用 mtdblock 作为设备名, mtdblock 属于 ftl 层,ftl 转换的效率很低,而且不安全,操作 ftl 不需要 erase 操作,完全像 block 设备一样。

  • 相关阅读:
    c# winform DataGridView导出数据到Excel中,可以导出当前页和全部数据
    水晶报表动态加载图片(签名)
    第1章 开启Threejs之旅(一)
    Python中@contextmanager的用法
    Systemd
    Python中with的用法
    systemctl的配置和使用
    /*CS5460_Note_1*/
    Just try the code
    MCP2515无BUG版本驱动(C文件)
  • 原文地址:https://www.cnblogs.com/jakebo/p/4671953.html
Copyright © 2011-2022 走看看