This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to put a linux root filesystem on NAND flash on the DM6467T EVM. I have been able to do so using the jffs2 file system, using the instructions below, copied from another e2e forum post. I want to use the yaffs2 file system instead, but haven't been able to. I followed the instructions from the wiki (link below) to patch the kernel with yaffs2 support. I ran the patch script, changed the settings in menuconfig, recompiled the kernel, and loaded into flash where linux boots from. I then followed the jffs2 instructions, changing the mount command to use "-t yaffs2" instead of "-t jffs2". The problem occurs during step 6, when I extract the tarball to mtd3, from nfs. It copies the first 27 files correctly, then exits with the error:
tar: can't open 'bin/mountpoint': Cannot allocate memory
Any ideas?
yaffs2 instructions:
http://processors.wiki.ti.com/index.php/Filesystem_in_NOR_or_NAND
File system on NAND flash instructions.
root@dm6467-evm:~# flash_eraseall -j /dev/mtd3
Erasing 128 Kibyte @ 7aa0000 -- 100 % complete.Cleanmarker written at 7a80000.
root@dm6467-evm:~# mkdir /mnt/nand
root@dm6467-evm:~# mount -t jffs2 /dev/mtdblock3 /mnt/nand
root@dm6467-evm:~# cd /mnt/nand
root@dm6467-evm:~# tar –xvf /rootfs.tar
This step takes a while to un-tar the whole file system to the NAND partition.
root@dm6467-evm:~# cd /
root@dm6467-evm:~# umount /mnt/nand
Hi,
Andrew Muehlfeld said:tar: can't open 'bin/mountpoint': Cannot allocate memory
What is the size of the mounted NAND partition? I assume the partition size is not enough to hold the contents for the file system.
Regards, Sudhakar
The file system itself is 61M on an ext4 filesystem. The tarball is 51M.
The file system partition is 128,581,632 bytes, as shown below, an excerpt from boot output. Looks to me like there is plenty of room on the NAND file system partition.
Creating 4 MTD partitions on "davinci_nand.0":
0x000000000000-0x000000020000 : "params"
0x000000020000-0x000000160000 : "bootloader"
0x000000160000-0x000000560000 : "kernel"
0x000000560000-0x000008000000 : "filesystem"
The extraction errors out after only 28 files are extracted. The files appear to have extracted successfully, but if I reboot and remount, they are gone. I'm guessing they are being cached in RAM, and are never written to NAND in the first place, and the error occurs when yaffs2 reaches its caching limit. Just a guess, I don't actually know a lot about how yaffs2 works.
I get the following message in dmesg 67 times when extracting:
yaffs: yaffs tragedy: no more erased blocks
yaffs: !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
yaffs: yaffs tragedy: no more erased blocks
yaffs: !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
...
I did execute flash_eraseall -j /dev/mtd3 before extacting (but not before checking to see if the files were gone after reboot).
Here are my yaffs2 options in menuconfig. I am using the DM6467T EVM, which has 2048 byte page NAND memory.
The error boils down to "I can't find any more valid blocks to use!", so there's confusion between the filesystem and the flash about what's valid. I would try:
a) Don't enable 512 byte support too, just 2048.
b) Try just 'flash_eraseall' and "waste" the time it takes for yaffs2 to figure this information out itself.
Thanks Tom. My yaffs2 file system is up and running now. Here's a little more detail for anyone with the same problem down the road. I dropped the -j option and instead used the command:
flash_eraseall /dev/mtd3
The -j option is specific for the jffs2 filesystem. It uses reserved bits to mark blocks as already erased, which apparently confuses yaffs2. I didn't have to remove 512 byte support.