# flash_eraseall /dev/mtd0
flash_eraseall: can't open '/dev/mtd0': Permission denied
离线
对, 是主线 Linux 4.13-y
[ 0.000000] Kernel command line: console=ttySl,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:960k(uboot)ro,64k(dtb)ro,1M(ext1)ro,1M(ext2),6M(kernel)ro,-(fs) root=/dev/ram0 rdinit=/init vt.global_cursor_default=0
# cat /proc/mtd
dev: size erasesize name
mtd0: 000f0000 00010000 "uboot"
mtd1: 00010000 00010000 "dtb"
mtd2: 00100000 00010000 "ext1"
mtd3: 00100000 00010000 "ext2"
mtd4: 00800000 00010000 "kernel"
mtd5: 01500000 00010000 "fs"
离线
谢谢大神, 果然是 ro 的问题,去掉就好了.
# flashcp -v zImage /dev/mtd4
Erasing block: 113/113 (100%)
Writing kb: 7172/7172 (100%)
Verifying kb: 7172/7172 (100%)
离线
https://github.com/vamanea/mtd-utils/blob/master/flashcp.c
https://raw.githubusercontent.com/vamanea/mtd-utils/master/flashcp.c
接下来要把这个 flashcp 源码嵌到自己应用中去了。
用于在线刷机,
不能中途拔电源。
最近编辑记录 awfans (2018-06-27 18:05:48)
离线