This is the mail archive of the
mailing list for the eCos project.
Re: How to incorporate a file system image when building eCos app
On Tue, 15 Feb 2011, Michael Bergandi wrote:
> Ok, made some progress.
> I made the file system image with:
> $ mkfs.jffs2 -r myfs -o myfs.jffs2
> where the myfs directory contains the contents of my file system.
> So, the 'test' directory is at the root of the jffs2 fs image.
> Confirmed this by mounting the image on my host.
> Then, I converted the jffs2 image to a '.h' to be included in my test
> app. I have file2c.tcl script for such purposes.
This is trick. The eCos synthetic target provides FLASH I/O support
> I build the Linux Synthetic target with the required supporting
> packages. In my working directory, where the root of the ecos tree is,
> I do the following:
> $ mkdir synthbuild
> $ cd synthbuild
> $ ecosconfig new linux
> $ ecosconfig add posix fileio net freebsd_net eth_drivers linux_compat
> flash crc jffs2
As you added 'flash' package, the flash parts on the target will be
simulated via regular file (by default its name is 'synthv2.flash') In
fact you can create such file (=flash image) using mkfs.jffs2 with some
additional options (pad size, erase size, etc. for a reference look on
flash defaults in eCos config file).
> $ ecosconfig tree
> $ make
> Everything builds without issue.
Ok, and what's about fs/jffs2 eCos tests?
make -C fs/jffs2/currents tests
./install/tests/fs/jffs2/current/tests/jffs2_1 -mw -io
Do jffs2 tests pass? If you can see 'synthv2.flash' creates itself on
the first test run. Look on the sources of tests and you will get a tip
how to manage your issue. In two words, Do not use file2c.tcl converter,
and use flash image file. When you port image to real target call about
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss