I have a i.mx6 based board running using buildroot and linux. This board have two storages nand and emmc. The nand had full rootfs and kernel on itself. I am now booting from SD card. From the boot logs I can see the nand and emmc partition getting detected

[    3.440294] 5 ofpart partitions found on MTD device gpmi-nand
[    3.446084] Creating 5 MTD partitions on "gpmi-nand":
[    3.451148] 0x000000000000-0x000000200000 : "boot"
[    3.456431] 0x000000200000-0x000000500000 : "scratch"
[    3.461632] 0x000000500000-0x000000b00000 : "kernel"
[    3.467091] 0x000000b00000-0x000001100000 : "recovery"
[    3.472521] 0x000001100000-0x000010000000 : "rootfs"
[    3.481312] gpmi-nand 112000.gpmi-nand: driver registered.

and emmc

[    4.318175]  mmcblk0: p1 p2

I can see the devices for nand are registered and shown in /dev/mtd*. Now I am using nand and mmc-utils provided by buildroot. I am trying to write some data on nand like this.Writing a simple text file test.txt,

#nandwrite -b 1 -n /dev/mtd0 -p /test.txt

See full error log on PasteBin

#flash_erase /dev/mtd0

flash_erase: error!: no start erase block specified
flash_erase: error!: no erase block count specified
flash_erase: error!: Try `--help' for more information

Can anyone tell the correct way/steps to be followed in case of nand, sd interaction. I followed this thread

StackExchange: how-can-i-flash-erase-mtd0

Similarly I am not able to flash, or do anything with emmc.

#mmc status get /dev/mmcblk0
SEND_STATUS response: 0x00000900

This looks ok, but how to really write or erase mmc? There are many commands associted with mmc , and not know which should I use,

mmc-utils manpage

Some more checks

# mtdinfo 
Count of MTD devices: 5
Present MTD devices: mtd0, mtd1, mtd2, mtd3, mtd4
Sysfs interface supported: yes
# mtd
mtd_debug mtdev-test mtdev2tuio mtdinfo
# mtdev
mtdev-test mtdev2tuio
# mtdev-test 
Usage: mtdev <device>
# mtdev-test /dev/mtd0
error: could not grab the device

I am guessing that maybe nand devices are locked, but how to check that?

What are the prerequisites/steps to access nand?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.