Altera_Forum
Honored Contributor
16 years agoFlash locked !
Hi all,
My configuration for uClinux is : uClinux-dist-20090618.tar.bz2 nios2gcc-20080203.tar.bz2 I followed this tutorial to instanciate a "Spansion S29GL01GP 64Mx16bit (128Mbyte) Nor Flash" on a DBM3C40 devboard : http://www.nioswiki.com/index.php?title=mtd&highlight=mtd When I boot uClinux after a "make", here is the log concerning the flash part : -------------------------------------------------------------------------- physmap platform flash device: 02000000 at 00000000 physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 physmap-flash.0: CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. cmdlinepart partition parsing not available RedBoot partition parsing not available Using physmap partition information Creating 2 MTD partitions on "physmap-flash.0": 0x000000200000-0x000000400000 : "romfs/jffs2" 0x000000000000-0x000000200000 : "loader/kernel" -------------------------------------------------------------------------- Then I try the traditionnal command to mount something : -------------------------------------------------------------------------- /> mkdir /mnt/configflash /> chmod 777 /mnt/configflash /> mount -t jffs2 /dev/mtdblock0 /mnt/configflash -------------------------------------------------------------------------- But after 1 or 2 seconds, I got these lines (automatically) : -------------------------------------------------------------------------- /> MTD do_write_buffer(): software timeout Write clean marker to block at 0x001c0000 failed: -5 MTD do_write_buffer(): software timeout Write clean marker to block at 0x001a0000 failed: -5 MTD do_write_buffer(): software timeout Write clean marker to block at 0x00180000 failed: -5 MTD do_write_buffer(): software timeout ...... ..... -------------------------------------------------------------------------- Then I tried another command to first erase all the blocks but one more time, the same error : -------------------------------------------------------------------------- /> flash_eraseall -j dev/mtd0 Erasing 128 Kibyte @ 0 -- 0 % complete.MTD do_write_buffer(): software timeout flash_eraseall: dev/mtd0: MTD write failure: Input/output error Erasing 128 Kibyte @ 20000 -- 6 % complete.MTD do_write_buffer(): software timeout .... .... (up to 100%) -------------------------------------------------------------------------- After searching the web concerning this error, I found this : 3) "eraseall: /dev/mtd0: MTD Erase failure: Input/output error" Possible reason: If you get this message for each block than probably write protection is on. Check the WP pin So I decided to activate the "unlock" option in "make menuconfig" -> MTD-utils section but unfortunately it doesn't generate a "flash_unlock" executable after a "make" so I add some lines to the Makefile located in (~/nios2-linux/uClinux-dist/user/mtd-utils) : TARGETS-$(CONFIG_USER_MTDUTILS_UNLOCK) += flash_unlock $(ROMFSINST) -e CONFIG_USER_MTDUTILS_UNLOCK build-$(VER)/flash_unlock /bin/flash_unlock After a "make", I successfully obtain a "flash_unlock" executable in (~/romfs/bin) but when I try this : -------------------------------------------------------------------------- /> flash_unlock /dev/mtd0 /> Could not unlock MTD device: /dev/mtd0 -------------------------------------------------------------------------- I don't understand what is wrong in my procedure... Can the NOR Flash on DBM3C40 have a write protection (PIN) enabled by default (to the VCC) and which must be disabled manually (with pin assignements in Quartus) ? Thanks for your help ! Papy