下载方法|用单线程|避免多扣 | 帖子规范|求助必读|发帖建议 | 积分策略|勋章介绍|新人必读 | 获取金币|推广论坛|出售帖子 | 基本礼节|致会员信|版规总则 |
禁涉政治|反对低俗|举报专帖 | 征集相片|留下足迹|推荐精华 | 上传附件|制作分卷|使用网盘 | 禁发qq群|恶意灌水|纯表情帖 | 加入团队|监督机制|安全上网 |
在Ubuntu系统下使用MMCBLK读写eMMC芯片教程(命令行模式) 首先,您需要安装Ubuntu操作系统才能进行以下操作,为了更方便的使用您可以将系统安装到虚拟机或U盘。 操作系统链接:https://cn.ubuntu.com 命令行模式读写eMMC操作步骤 虚拟机USB兼容性设置: 如果使用的是虚拟机,建议先将USB兼容性设置为USB3.x。 1、查看设备与驱动 在命令行下输入lsusb -t查看树形结构显示USB设备的连接,如果显示Driver=rtsx_usb就可以进行下一步操作,新版Ubuntu操作系统一般是自带此驱动。 2、查看eMMC芯片列出分区 把放好芯片的读写器插入电脑,输入命令ls /dev/mmc*查看eMMC芯片是否正确挂载。如果挂载正常,会在命令下显示/dev/mmcblk0、/dev/mmcblk0boot0、/dev/mmcblk0boot1等分区,它们分别对应eMMC芯片的User、Boot0、Boot1分区。 3、切换系统权限 输入命令sudo su提升权限,这里会要求输入管理员密码,请按要求输入授权即可。 4、禁用只读模式:Disable read-only mode 依次输入以下命令并回车,将默认的只读模式关闭,以便我们接下来可以顺利读取数据和写入数据。 echo 0 > /sys/block/mmcblk0/force_ro echo 0 > /sys/block/mmcblk0boot0/force_ro echo 0 > /sys/block/mmcblk0boot1/force_ro 5、读取数据和写入数据 接下来就可以使用Linux下的dd命令进行读写操作,用到的命令解释以下: sudo 授权普通用户执行管理员命令 dd 复制文件的命令 bs=4M 设置块大小 if= 选择源盘(或文件)的路径 of= 选择目标文件(或目标盘)的路径 status=progress 显示进度状态 5.1、备份数据 备份boot0数据 sudo dd if=/dev/mmcblk0boot0 of=emmc/boot0.bin 备份boot1数据 sudo dd if=/dev/mmcblk0boot1 of=emmc/boot1.bin 备份user数据 sudo dd if=/dev/mmcblk0 of=emmc/user.bin bs=4M status=progress 5.2、写入数据 恢复boot0数据到芯片 sudo dd if=emmc/boot0.bin of=/dev/mmcblk0boot0 恢复boot1数据到芯片 sudo dd if=emmc/boot1.bin of=/dev/mmcblk0boot1 恢复user数据到芯片 sudo dd if=emmc/user.bin of=/dev/mmcblk0 bs=4M status=progress 6、安装mmc-utils apt install mmc-utils 7、查看Ext_Csd信息: mmc extcsd read /dev/mmcblk0 获取CID: cat /sys/block/mmcblk0/device/cid 获取CSD: cat /sys/block/mmcblk0/device/csd 获取OCR: cat /sys/block/mmcblk0/device/ocr 获取RCA: cat /sys/block/mmcblk0/device/rca 获取DSR: cat /sys/block/mmcblk0/device/dsr 查看eMMC芯片寿命: sudo mmc extcsd read /dev/mmcblk0 | grep Life eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01 eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x03 从eMMC5.0开始,支持健康度查询,以记录芯片的读写次数换算为寿命信息。数据越靠近0越好,0x01表示0-10%之间,0x0A表示90%-100%之间,0x0B表示寿命已尽。 # cat /sys/block/mmcblk0/device/* # mmc help Usage: mmc extcsd read Print extcsd data from mmc writeprotect boot get Print the boot partitions write protect status for mmc writeprotect boot set Set the boot partitions write protect status for This sets the eMMC boot partitions to be write-protected until the next boot. mmc writeprotect user set Set the write protect configuration for the specified region of the user area for "none" - Clear temporary write protection. "temp" - Set temporary write protection. "pwron" - Set write protection until the next poweron. NOTE! The area must start and end on Write Protect Group boundries, Use the "writeprotect user get" command to get the Write Protect Group size. mmc writeprotect user get Print the user areas write protect configuration for mmc disable 512B emulation Set the eMMC data sector size to 4KB by disabling emulation on mmc gp create <-y|-n|-c> Create general purpose partition for the Dry-run only unless -y or -c is passed. Use -c if more partitioning settings are still to come. NOTE! This is a one-time programmable (unreversible) change. To set enhanced attribute to general partition being created set To set extended attribute to general partition set mmc enh_area set <-y|-n|-c> Enable the enhanced user area for the Dry-run only unless -y or -c is passed. Use -c if more partitioning settings are still to come. NOTE! This is a one-time programmable (unreversible) change. mmc write_reliability set <-y|-n|-c> Enable write reliability per partition for the Dry-run only unless -y or -c is passed. Use -c if more partitioning settings are still to come. NOTE! This is a one-time programmable (unreversible) change. mmc status get Print the response to STATUS_SEND (CMD13). mmc bootpart enable Enable the boot partition for the Disable the boot partition for the To receive acknowledgment of boot from the card set to 1, else set it to 0. mmc bootbus set Set Boot Bus Conditions. mmc bkops enable Enable the eMMC BKOPS feature on NOTE! This is a one-time programmable (unreversible) change. mmc hwreset enable Permanently enable the eMMC H/W Reset feature on NOTE! This is a one-time programmable (unreversible) change. mmc hwreset disable Permanently disable the eMMC H/W Reset feature on NOTE! This is a one-time programmable (unreversible) change. mmc sanitize Send Sanitize command to the This will delete the unmapped memory region of the device. mmc rpmb write-key Program authentication key which is 32 bytes length and stored in the specified file. Also you can specify '-' instead of key file path to read the key from stdin. NOTE! This is a one-time programmable (unreversible) change. Example: $ echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH | \ mmc rpmb write-key /dev/mmcblk0rpmb - mmc rpmb read-counter Counter value for the mmc rpmb read-block |
手机版|家电维修技术论坛 ( 鄂ICP备09003585号-2 )
GMT+8, 2024-11-21 17:05 , Processed in 0.039275 second(s), 8 queries , Gzip On, MemCache On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.