public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Configuring EB40A for JFFS2
@ 2007-06-13 13:36 Paul D. DeRocco
  2007-06-13 14:19 ` Jürgen Lambrecht
  0 siblings, 1 reply; 3+ messages in thread
From: Paul D. DeRocco @ 2007-06-13 13:36 UTC (permalink / raw)
  To: eCos Discuss

I have an old EB40A (ARM7) board, and am having trouble figuring out how to
partition its 2MB flash memory. I already have Redboot burned into the
flash, and FIS set up. The bootable version of Redboot is represented by an
FIS image called "Redboot", covering the first 128K of flash. Not sure if
that was necessary, but it seemed like a Good Idea.

I have a boot script which currently just consists of "fis list"; I'll add
an "fis load" command later. It doesn't appear as an image in "fis list",
but I assume that that's because it's short, and there's some magic that
allows short boot scripts to be stored directly in the FIS directory,
instead of in an image. (Did I read that somewhere, or did I just make that
up?)

Anyway, what I want to do next is create an eCos app that uses JFFS2. The
rest of my flash, then, must be divided between the area where I store the
app, and the area used for JFFS2 file storage. I don't want to store the app
inside a JFFS2 file, as I'm content to use Redboot to write each new version
of the app into flash manually.

I have a vague memory of reading somewhere that there's a way to get JFFS2
to use a named FIS image, rather than having to hard code a start address
and length in my eCos app. Is this true? If so, do I first use Redboot to
manually create an empty image of the appropriate name, using "fis create -n
...", and then later let Redboot create an image for my app using the rest
of the space? Or should I first create an image for my app, possibly padding
it for future growth, and then create an empty image for JFFS2 to use out of
the remaining space?

Next question: with only 2M flash, and with my app written in C++, I don't
have a lot of room to spare. I'd like to store my app as GZIPped binary, but
my current version of Redboot doesn't have support for that. Among the
available packages, I see something called "Zlib compress/decompress". Is
that the same thing as GZIP? If I include that, will it automatically add
support for the "fis load" command -d option, or do I have to do something
else?

(I do have a working RAM version of Redboot, which I can use to burn a new
ROM version into flash, by the way.)

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com 


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Configuring EB40A for JFFS2
  2007-06-13 13:36 [ECOS] Configuring EB40A for JFFS2 Paul D. DeRocco
@ 2007-06-13 14:19 ` Jürgen Lambrecht
  2007-06-15  6:25   ` Paul D. DeRocco
  0 siblings, 1 reply; 3+ messages in thread
From: Jürgen Lambrecht @ 2007-06-13 14:19 UTC (permalink / raw)
  To: Paul D. DeRocco; +Cc: eCos Discuss

Paul D. DeRocco wrote:
> I have an old EB40A (ARM7) board, and am having trouble figuring out how to
> partition its 2MB flash memory. I already have Redboot burned into the
> flash, and FIS set up. The bootable version of Redboot is represented by an
> FIS image called "Redboot", covering the first 128K of flash. Not sure if
> that was necessary, but it seemed like a Good Idea.
> 
> I have a boot script which currently just consists of "fis list"; I'll add
> an "fis load" command later. It doesn't appear as an image in "fis list",
> but I assume that that's because it's short, and there's some magic that
> allows short boot scripts to be stored directly in the FIS directory,
> instead of in an image. (Did I read that somewhere, or did I just make that
> up?)
> 
> Anyway, what I want to do next is create an eCos app that uses JFFS2. The
> rest of my flash, then, must be divided between the area where I store the
> app, and the area used for JFFS2 file storage. I don't want to store the app
> inside a JFFS2 file, as I'm content to use Redboot to write each new version
> of the app into flash manually.
> 
My flash of 64MB is partitioned this way:
    1. 0x1000_0000, 0x0004_0000 ( 256KB): RedBoot
    2. 0x1004_0000, 0x0008_0000 ( 512KB): application
    3. 0x100C_0000, 0x0002_0000 ( 128KB): spare
    4. 0x100E_0000, 0x03F0_0000 (  63MB): jffs2 partition (63MB)
    5. 0x13FE_0000, 0x0002_0000 ( 128KB): FIS directory and RedBoot config

In redboot, I create a jffs2 partition this way:
fis create -f 0x100E0000 -l 0x03F00000 -n jffs2

Don't forget there is a bug in the ARM compiler 3.2.1 concerning jffs2.

application code:
#include <pkgconf/fs_jffs2.h>       // Address of JFFS2
   mount ("/dev/flash1", JFFS2DIR, "jffs2"); // Initialize File system
(this mounts the "jffs2" partition to the mount point (a directory) JFFS2DIR, "/" in my case (root))

> I have a vague memory of reading somewhere that there's a way to get JFFS2
> to use a named FIS image, rather than having to hard code a start address
> and length in my eCos app. Is this true? If so, do I first use Redboot to
> manually create an empty image of the appropriate name, using "fis create -n
> ...", and then later let Redboot create an image for my app using the rest
> of the space? Or should I first create an image for my app, possibly padding
> it for future growth, and then create an empty image for JFFS2 to use out of
> the remaining space?
I don't follow completely (no time to read in detail).
Don't need to create an image.  If you fixed the jffs2 bug in the ARM 3.2.1 compiler, the partition will be initialized at first mount by writing a magic number (0x1985 I believe).
In redboot you can already mount the partition and use 'ls' and 'ls -d DIR'.

Kind regards,

Jürgen Lambrecht

> 
> Next question: with only 2M flash, and with my app written in C++, I don't
> have a lot of room to spare. I'd like to store my app as GZIPped binary, but
> my current version of Redboot doesn't have support for that. Among the
> available packages, I see something called "Zlib compress/decompress". Is
> that the same thing as GZIP? If I include that, will it automatically add
> support for the "fis load" command -d option, or do I have to do something
> else?
> 
> (I do have a working RAM version of Redboot, which I can use to burn a new
> ROM version into flash, by the way.)
> 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [ECOS] Configuring EB40A for JFFS2
  2007-06-13 14:19 ` Jürgen Lambrecht
@ 2007-06-15  6:25   ` Paul D. DeRocco
  0 siblings, 0 replies; 3+ messages in thread
From: Paul D. DeRocco @ 2007-06-15  6:25 UTC (permalink / raw)
  To: eCos Discuss; +Cc: 'Jürgen Lambrecht'

> From: Jürgen Lambrecht
> 
> My flash of 64MB is partitioned this way:
>     1. 0x1000_0000, 0x0004_0000 ( 256KB): RedBoot
>     2. 0x1004_0000, 0x0008_0000 ( 512KB): application
>     3. 0x100C_0000, 0x0002_0000 ( 128KB): spare
>     4. 0x100E_0000, 0x03F0_0000 (  63MB): jffs2 partition (63MB)
>     5. 0x13FE_0000, 0x0002_0000 ( 128KB): FIS directory and 
> RedBoot config
> 
> In redboot, I create a jffs2 partition this way:
> fis create -f 0x100E0000 -l 0x03F00000 -n jffs2
> 
> application code:
> #include <pkgconf/fs_jffs2.h>       // Address of JFFS2
>    mount ("/dev/flash1", JFFS2DIR, "jffs2"); // Initialize 
> File system (this mounts the "jffs2" partition to the mount 
> point (a directory) JFFS2DIR, "/" in my case (root))

Thanks for your help. I decided to manually divide the 32 erasable 64K
blocks into 2 for Redboot, 14 for my app, 14 for JFFS2, and 2 left over at
the top for the flash directory, configuration data and boot script. (I
suppose one would have been enough.)

I'm merely assuming that the top of the flash is where the FIS directory is
stored, because that's where it says it's reading from when I do "fis list".
I'm a little confused, though, because "fis free" shows that space to be
free. (This is an EB40A ARM7 board.)

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com 


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-14 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-13 13:36 [ECOS] Configuring EB40A for JFFS2 Paul D. DeRocco
2007-06-13 14:19 ` Jürgen Lambrecht
2007-06-15  6:25   ` Paul D. DeRocco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).