Hi pxs,
> Can you explain how you create the image in more detail?
1. In your unix environment create a directory that will serve as the root of your jffs2 filesystem.
2. Then populate this directory with all of the directories, files, links, etc. that are needed for your target system.
3. Run mkfs.jffs2, specifying the directory you created in step 1 (the -r, -d, or --root option).
You'll need to specify the eraseblock size also. A single 8-bit device with 64K sector size would be
"-e 0x10000", two of them in parallel would be "-e 0x20000" and so on. It's also a good idea to explicitly
set the endian order in your makefiles as a precaution, use -l option for nios. By default mkfs.jffs2 will
use the endian order of the machine you run it on (for nios and x86 this is never a problem since
they're both little endian -- but PowerPC hosts can cause issues). So an invocation of mkfs.jffs2
might look something like this if your file structure is in the directory "ecos_root":
$ mkfs.jffs2 -d ecos_root -e 0x10000 -o jffs2.bin -l
4. Once you have the binary, you can use bin2flash and the nios2-flash-programmer to load
the binary into your jffs2 partition on your target board.
> Do you use a Linux box to create it or do you download the source and compile it on a
> windows box using cygwin, or do you compile it in NIOS?
I always use mkfs.jffs2 on a unix box. Under cygwin, you'll loose some of your file attributes (like
the execute bits or example) which can be troublesome for embedded linux targets. But for ecos,
you may not really care.
Prior to Nios II 5.0, the Microtronix uClinux linux came with host gcc ... and the mkfs.jffs2 source code
available at:
http://www.psyent.com/download (
http://www.psyent.com/download) would build cleanly in an SDK shell windown. I haven't
tried these sources with the latest 5.0 stuff yet. I know there are problems building this code in a
"normal" cygwin environment from www.cygwin.com.
Regards,
--Scott