Altera_Forum
Honored Contributor
15 years agoWrite filesystem on flash
Hi!
I'm working with nios2 nommu and I have a 8 MB SDRAM and 8 MB CFI FLASH. For create a filesystem in a flash I create a kernel with a miminal service (without network and webserver) to start and copy all the files in ram to flash, in my rc the configuration is
hostname uClinux
mount -t proc proc /proc -o noexec,nosuid,nodev
mount -t sysfs sysfs /sys -o noexec,nosuid,nodev
mount -t devpts devpts /dev/pts -o noexec,nosuid
mount -t jffs2 /dev/mtdblock0 /mnt
mkdir /mnt/mnt
mkdir /mnt/proc
mkdir /mnt/sys
mkdir /mnt/tmp
mkdir /mnt/var/
mkdir /mnt/var/tmp
mkdir /mnt/var/log
mkdir /mnt/var/run
mkdir /mnt/var/lock
mkdir /mnt/var/empty
cp -a /bin /mnt
cp -a /dev /mnt
cp -a /etc /mnt
cp -a /home /mnt
cp -a /init /mnt
cp -a /lib /mnt
cp -a /sbin /mnt
cp -a /usr /mnt
cp /home/rc /mnt/etc But when my image is larger then 2 MB (when my romfs is a little bigger) I have problem to write on flash memory, when the kernel try copy the /home to /mnt the RAM "crash" I have a message with stack trace call. Somebody knows a best pratice to write the files system on flash (for production)? There's a way to create a .FLASH or .BIN of a initramfs_data.cpio.gz to write on flash directly by jtag or u-boot? Thank you very much. Caio Pereira Caio Pereira