Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Oct 2006 11:21 AM by  ashwinb@logicpd.com
How to create JFFS2system image?
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages
tomyang
New Member
New Member
Posts:


--
02 Oct 2006 12:30 AM
    Hi,
    My host system is an x86 processor. I want to
    create a file system for my Flash memory. I used
    JFFS2. How can I create a file system image?

    Thanks in advance for any help!
    ashwinb@logicpd.com
    New Member
    New Member
    Posts:


    --
    04 Oct 2006 07:07 AM
    You will want to create a directory that represents the filesystem for your target. Populate this directory with all the necessary info and then use the "mkfs.jffs2" tool to create the JFFS2 image.

    You can find the MAN page for mkfs.jffs2 her.

    An example call would be something like:

    mkfs.jffs2 --devtable=metafile.txt \
    --eraseblock=0x20000 \
    --pad=0xe80000 \
    --big-endian --root=rfs --output=rootfs.jffs2


    Where the "--root" is pointing to this directory you created.

    Regards
    tomyang
    New Member
    New Member
    Posts:


    --
    11 Oct 2006 07:12 PM
    Hi,Cypher
    I downloaded busybox 1.2.1 to build JFFS2 image. I have some questions.
    1. If the image file is bigger the 16 Mb. How could I adjust the parameter "eraseblock" and "pad" of mkfs.jffs ? Could you give me an example ?

    2. My develop board is PXA270. Should I use little-endian or big-endian ?

    3. If I use the zImage 2.6.16-rc2 which download from logic web site, any parameter need be added when I JFFS2 image file ?

    Regards
    ashwinb@logicpd.com
    New Member
    New Member
    Posts:


    --
    12 Oct 2006 07:36 AM
    I'm using the exact same system as you are right now. I'm playing with the PXA270 with Kernel v2.6.18 and a JFFS2 based filesystem.

    Rather than building Busybox by itself, please check out Buildroo, which allows you not only build Busybox, but other handy tools and package them all up into a nice JFFS2 image with the appropriate /dev files create all in one go.

    Within the Buildroot configuration for "Target Options" I used an erase size of 0x40000 and pad size of 0x01000000 (16MB).

    If you want to make the filesystem be larger than 16MB know that you will have to change the MTD map within the Kernel as well as the YAFFS partitioning within LoLo.

    For the PXA270 you will use little-endian.

    For the zImage you get from Logic's website, it is already fully setup to use JFFS2 as it's filesystem, so nothing additional needs to be done.

    Regards
    tomyang
    New Member
    New Member
    Posts:


    --
    13 Oct 2006 10:32 AM
    Thank you for your help. I still have some questions.
    1 My PXA270 is CENGPXA270-520-10-504HC. It has 32MB NOR flash. Does it mean that I can use Buildroot to build 32MB file system ?
    2. I have try to build 2.6.18 kernel. But it has a lot of errors. Does it need patch something ? Could you give me your kernel configure file ?
    3. How could I mount Compact Flash in Linux ? the command
    "mount /dev/had /mnt/cf" seems not work.

    Please give me some advice, thank you.
    ashwinb@logicpd.com
    New Member
    New Member
    Posts:


    --
    13 Oct 2006 11:21 AM
    If it matters, my PXA270 is SDK-PXA270-520-10-6432 and has the 32MB flash as well.

    But a portion of that flash is used for the bootloader and another portion for the Kernel image. By default Logic uses a partitoning scheme like:

    0x00000000-0x000c0000 : "Bootloader"
    0x000c0000-0x01000000 : "YAFFS"
    0x01000000-0x02000000 : "Filesystem"

    Where YAFFS refers to the partition that contains the Kernel image.

    That being said, you clearly don't (can't) want to create a 32MB image as you will have no space for the rest of the stuff. Now, you can indeed shrink the YAFFS partition to be smaller and thus enlarge the Filesystem partition, but you will have to leave the Bootloader partition/location intact.

    The stock Kernel.org 2.6.18 Kernel should definitely build. Make sure that you can do that first before attempting to apply any patches. How did you get the cross-compilers for the PXA?

    The Buildroot program I mentioned in my previous post will build these cross-compilers for you to use.

    The stock 2.6.18 Kernel is missing the MTD maps code. So you will need to patch the Kernel for that at the least to even get up and running on the PXA270. The stock Kernel is also missing the CF code which would allow you to mount it, so you will want to get those patches as well.

    Please look at thi thread to get your hands on the necessary patches.

    Regards
    You are not authorized to post a reply.