Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHow to Save Data in uClinux
hi I am trying to save data in to Flash. I want to load previous execute data and system setting before I turn it off. Did anyone know how to do this. Please tell who or share me so...
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- You need to mount flash correctly. Something like this... mkdir /mnt/flash mount -t jffs2 /dev/mtdblock2 /mnt/flash After mounted, you should be able to make file on the file system. either do cp command and copy file or use vi to create something text file. Since jffs2 is file system, you just want to open file or write file rather than direct read/write access to specific address on the flash. --- Quote End --- Hi nekojiru Below is my mtd system --- Quote Start --- root:/> cat /proc/mtd dev: size erasesize name mtd0: 02800000 00020000 "userspace" mtd1: 00100000 00020000 "U-Boot" mtd2: 00400000 00020000 "uImage1" mtd3: 00400000 00020000 "uImage2" mtd4: 00400000 00020000 "uImage3" mtd5: 00380000 00020000 "DEFAULT_MMU" mtd6: 00380000 00020000 "MAXIMUM_MMU" mtd7: 00380000 00020000 "USER_IMAGE" mtd8: 00020000 00020000 "options-bits" --- Quote End --- below is my filesystems --- Quote Start --- root:/> cat /proc/filesystems nodev sysfs nodev rootfs nodev proc nodev tmpfs nodev sockfs nodev pipefs nodev configfs nodev devpts nodev ramfs nodev jffs2 nodev autofs --- Quote End --- At first, I decide to mount mtdblock0 to mnt/flash --- Quote Start --- root:/> mkdir /mnt/flash root:/> mount -t jffs2 /dev/mtdblock0 /mnt/flash mount: mounting /dev/mtdblock0 on /mnt/flash failed: Invalid argument --- Quote End --- Then I think it is caused by mtdblock0 is not a jffs2 filesystem. I try to remove jffs2 and exec it --- Quote Start --- root:/> mount -t /dev/mtdblock0 /mnt/flash mount: can't read /etc/fstab: No such file or directory --- Quote End --- I realize inside my system, I don't have fstab file!!! Below is my executed result.. http://i55.tinypic.com/34q8f0h.jpg