[HD Mini Android Development] munjeni:
No way to write to flash, only can read:confused: Some info:

localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# ls
doc_loadbios flash_lock flashcp mkfs.jffs2 nanddump nftldump serve_image ubidetach ubinize ubiupdatevol
docfdisk flash_otp_dump ftl_check mkfs.ubifs nandtest recv_image sumtool ubiformat ubirename
flash_erase flash_otp_info ftl_format mtd_debug nandwrite rfddump ubiattach ubimkvol ubirmvol
flash_eraseall flash_unlock jffs2dump mtdinfo nftl_format rfdformat ubicrc32 ubinfo ubirsvol
localhost:~/mtd/install/sbin# ./nandtest
usage: nandtest [OPTIONS] <device>

-h, --help Display this help output
-m, --markbad Mark blocks bad if they appear so
-s, --seed Supply random seed
-p, --passes Number of passes
-o, --offset Start offset on flash
-l, --length Length of flash to test
-k, --keep Restore existing contents after test
localhost:~/mtd/install/sbin# ./ftl_check
usage: ftl_check device
localhost:~/mtd/install/sbin# ./ftl_check /dev/mtd0
Memory region info:
Region size = 512 mb Erase block size = 128 kb

No valid erase unit headers!
localhost:~/mtd/install/sbin# ./flash_otp_info /dev/mtd0
Usage: flash_otp_info [ -f | -u ] <device>
localhost:~/mtd/install/sbin# ./flash_otp_info -f /dev/mtd0
OTPSELECT: Inappropriate ioctl for device
localhost:~/mtd/install/sbin# ./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>
localhost:~/mtd/install/sbin# ./mtd_debug info /dev/mtd00
open(): No such file or directory
localhost:~/mtd/install/sbin# ./mtd_debug info /dev/mtd0
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 536870912 (512M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
mtd.oobsize = 64
regions = 0

localhost:~/mtd/install/sbin# ./nandwrite /dev/mtd0 /root/ttt/mtd.img
Writing data to block 0 at offset 0x0
libmtd: error!: cannot write 2048 bytes to mtd0 (eraseblock 0, offset 0)
error 5 (Input/output error)
Erasing failed write from 00000000 to 0x01ffff
libmtd: error!: bad eraseblock number 131072, mtd0 has 4096 eraseblocks
nandwrite: error!: /dev/mtd0: MTD Erase failure
error 22 (Invalid argument)
Data was only partially written due to error
: Invalid argument
localhost:~/mtd/install/sbin# ./mtdinfo /dev/mtd0
mtd0
Name: msm_nand
Type: nand
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 4096 (536870912 bytes, 512.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size: 2048 bytes
OOB size: 64 bytes
Character device major/minor: 90:0
Bad blocks are allowed: true
Device is writable: true

localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# cat /root/ttt/mtd.img > /dev/mtd0
cat: write error: Input/output error
localhost:~/mtd/install/sbin# ./mtd_debug erase /dev/mtd0 0x200000 0x20000
MEMERASE: Input/output error
localhost:~/mtd/install/sbin# ./flash_erase -N -u /dev/mtd0 0x200000 0x20000
Erasing 128 Kibyte @ 200000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 16 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 220000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 17 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 240000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 18 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 260000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 19 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 280000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 20 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2a0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 21 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2c0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 22 (mtd0)
error 95 (Operation not supported)
flash_erase: error!: /dev/mtd0: MTD unlock failure
error 95 (Operation not supported)
Erasing 128 Kibyte @ 2e0000 -- 0 % complete libmtd: error!: MEMUNLOCK ioctl failed for eraseblock 23 (mtd0)
localhost:~/mtd/install/sbin# ./flash_erase --help
Usage: flash_erase [options] MTD_DEVICE <start offset> <block count>
Erase blocks of the specified MTD device.
Specify a count of 0 to erase to end of device.

-j, --jffs2 format the device for jffs2
-N, --noskipbad don't skip bad blocks
-u, --unlock unlock sectors before erasing
-q, --quiet do not display progress messages
--silent same as --quiet
--help display this help and exit
--version output version information and exit
localhost:~/mtd/install/sbin# ./flash_erase -N -j /dev/mtd0 0x200000 0x20000
flash_erase: error!: /dev/mtd0: unable to get NAND oobinfo
error 22 (Invalid argument)
localhost:~/mtd/install/sbin#
localhost:~/mtd/install/sbin# ./flash_erase -N /dev/mtd0 0x200000 0x20000
Erasing 128 Kibyte @ 200000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 16 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 220000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 17 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 240000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 18 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 260000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 19 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 280000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 20 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2a0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 21 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2c0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 22 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 2e0000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 23 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 300000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 24 (mtd0)
error 5 (Input/output error)
flash_erase: error!: /dev/mtd0: MTD Erase failure
error 5 (Input/output error)
Erasing 128 Kibyte @ 320000 -- 0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 25 (mtd0)