Marcelo Barros

i.MX28EVK: using NAND

Discussion created by Marcelo Barros on Jan 24, 2012
Latest reply on Jan 30, 2012 by Marcelo Barros

Hi

I have a working i.MX28EVK, booting from SDCARD. My image has mtd-utils and the kernel is compiled to support NAND, JFFS and UBIFS.

I added a NAND chip using the available socket and this memory is recognized when booting (full log attached as lognand.txt)

NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V 8-bit)

 

The default partitions are created (mtd0 and mtd1) as well. However, I can not write to these partitions. For instance, if I try to use the nandtest utility, I receive many "Input/output" errors:

root@host ~$ nandtest /dev/mtd0
ECC corrections: 0
ECC failures   : 0
Bad blocks     : 0
BBT blocks     : 0
00000000: erasing... MEMERASE: Input/output error
00020000: erasing... MEMERASE: Input/output error
...

 

The same error if I try uibformat:

root@host ~$ ubiformat /dev/mtd1
ubiformat: mtd1 (nand), size 247463936 bytes (236.0 MiB), 1888 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 1887 -- 100 % complete  
ubiformat: 1888 eraseblocks are supposedly empty
ubiformat: formatting eraseblock 0 --  0 % complete  
ubiformat: error!: failed to erase eraseblock 0
           error 5 (Input/output error)

It seems that some write protection is enabled or I am missing something.

 

Any tips ?

Thanks in advance

 

PS: I checked the board layout and it is possible to see the write protection pin connected to GPIO0_28. Searching, I discovered that it is necessary to add  /sys/class/gpio option to kernel image in order to read/write any GPIO pin. I did it by I am not sure how to map GPIO0_28 into /sys/class/gpio/gpio[n]. Worst, I am not sure if the problem is related to this pin or not.

Outcomes