This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Is there any RedBoot related setting needed forusingJFFS2 to access Flash memory by ecos RAM application? Thanks a lot.


Thanks a lot.

I can get the mkfs.jffs2 utility worked under cygwin, so I installed the
accompany test file jffs2.img (located in
/fs/current/support/jffs2/jffs2.img) as shown below:

RAM: 0x00000000-0x02000000, 0x00002000-0x01f21000 available
FLASH: 0x40000000 - 0x40800000, 128 blocks of 0x00010000 bytes each.
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x40000000  0x40000000  0x00020000  0x00000000
RedBoot config    0x407E0000  0x407E0000  0x00001000  0x00000000
FIS directory     0x407F0000  0x407F0000  0x00010000  0x00000000
JFFS2             0x40100000  0x40100000  0x00600000  0x00100000


now I can write and read from the jffs2 fs. fileio1.c test program runs
fine.  but when I am doing a mount( ), I still get the info:

.....
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080008: 0xdc6
......

Did I do anything wrong?

Thank you very much.

BTW how can I build the tool mkfs.jffs? the binary I download from the web
can be executed under cygwin.


-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Gary D.
Thomas
Sent: 24 May 2003 17:02
To: jameshq@liverpool.ac.uk
Cc: eCos Discussion
Subject: RE: [ECOS] Is there any RedBoot related setting needed
forusingJFFS2 to access Flash memory by ecos RAM application? Thanks a
lot.


On Sat, 2003-05-24 at 05:41, jameshq@liverpool.ac.uk wrote:
> Thanks a lot gary.
> but As I metioned in the previous post:
>
> How can I check whether the flash memory is ready for JFFS2 if setting
> needed to be done by RedBoot?
>
> (Step1) when I do a "board reset":
> Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
>
> RAM: 0x00000000-0x02000000, 0x00002000-0x01f21000 available
> FLASH: 0x40000000 - 0x40800000, 128 blocks of 0x00010000 bytes each.
>
> (Step2) and "fis list":
> RedBoot> fis list
> Name              FLASH addr  Mem addr    Length      Entry point
> RedBoot           0x40000000  0x40000000  0x00020000  0x00000000
> RedBoot config    0x407E0000  0x407E0000  0x00001000  0x00000000
> FIS directory     0x407F0000  0x407F0000  0x00010000  0x00000000
>
> (Step6) load and run the program
> eCOS configuration setting is:
> FLASH device drivers --> Instantiate in I/O block device API --> Name
> of
> flash device 1 block device ("dev/flash1") --> Static configuration
> selected --> Start offset from flash base (0x00100000); Length
> (0x00100000).
>
> Do you think there is any problem with the above setting? BTW What do
> you mean: "You'll need to build an appropriate JFFS2 image and
> then install it into FLASH (using RedBoot) before you start the
> application." ? Even when I just to run the JFFS2 test program
> fileio1? If I just want to create a file and store it to flash memory
> I still need to create the JFFS2 image and store this to flash first?
> If so does that mean all the flash file (JFFS2) are all created and
> stored to that JFFS2 image(act as a container)? Is this right? so
> could you please give me a little detail about how I can achieve this?
> Thank you very much indeed.
>

You have no JFFS2 installed, as far as I can see.

What you need to do is create a JFFS2 image on your host, using
'mkfs.jffs2'.  Then copy that image to your target and install it
into FLASH.  Only then will eCos be able to use the FLASH via JFFS2.

e.g. (you'll need to adapt the details for your situation)
* on the host:
  % mkfs.jffs2 -r jffs2_root -o JFFS2.img -e 0x10000
* on the target
  RedBoot> lo -r -b 0x100000 JFFS2.img
  RedBoot> fi cr -f 0x40100000 -l 0x006E0000 JFFS2 -b 0x100000

Note: you'll have to tell your eCos application where to find the JFFS2
image.  This is done by configuring the CDL component
CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1

Also, try looking at the JFFS2 test programs for guidance how to use
this file system.

>
>
>
> On Fri, 2003-05-23 at 09:01, QiangHuang wrote:
> > now I unlock the flash  by using the RedBoot, but I am getting
> another error
> > message, any idea? Thanks a lot. (I even tried the following steps:
> > 1. fis init -f
> > 2. fis unlock -f 0x40030000 -l 0x00700000
> > 3. load and run the ecos ram apps by redboot(without resetting the
> board)
> >
> >
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000008:
> > 0xf018
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x0000000c:
> > 0xf018
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000010:
> > 0xf018
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000018:
> > 0xf018
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x0000001c:
> > 0xf018
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000024:
> > 0x0414
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000028:
> > 0x0438
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x0000002c:
> > 0x0464
> >  instead
> > <5>jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
> 0x00000030:
> > 0x0480
> >  instead
> > <5>Further such events for this erase block will not be printed
> > <5>Cowardly refusing to erase blocks on filesystem with no valid
> JFFS2 nodes
> > <5>empty_blocks 15, bad_blocks 0, c->nr_blocks 16
> > <FAIL>: mount() returned -1 I/O error
> > <FAIL>: chdir() returned -1 No such entity
> >
> > What could be wrong?
>
> Are you sure that eCos is set up to use the correct area of FLASH for
> the JFFS2 image (this is configurable).
>
> > BTW does the magic bitmask has been set into flash memory before the
> > application runs? do I need to initialise anything?
>
> Yes, of course.  You'll need to build an appropriate JFFS2 image and
> then install it into FLASH (using RedBoot) before you start the
> application.
>
> >
> > Thank you very much.
> >
> >
> > -----Original Message-----
> > From: ecos-discuss-owner@sources.redhat.com
> > [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Andrew
> Lunn
> > Sent: 23 May 2003 12:26
> > To: QiangHuang
> > Cc: Ecos-Discuss
> > Subject: Re: [ECOS] Is there any RedBoot related setting needed for
> using
> > JFFS2 to access Flash memory by ecos RAM application? Thanks a lot.
> >
> >
> > On Fri, May 23, 2003 at 12:03:08PM +0100, QiangHuang wrote:
> > > Hi all:
> > >    Can somebody kindly tell me is there any relation ship between
> the
> > > RedBoot and the JFFS2? I want to the ecos application to access
> the JFFS2,
> > > do I need to setup something by RedBoot(e.g. unlock, or init?)
> before the
> > > ecos application can use JFFS2? (The situation is: I want to build
> ecos
> > RAM
> > > application and loaded by RedBoot, in ecos ram application I use
> JFFS2 to
> > > access the flash memory-store/read) Thanks a lot.
> >
> > The only thing you need to do is make sure they don't both try to
> use
> > the same blocks.
> >
> > > RedBoot> fis list
> > > Name              FLASH addr  Mem addr    Length      Entry point
> > > RedBoot           0x40000000  0x40000000  0x00020000  0x00000000
> > > RedBoot config    0x407E0000  0x407E0000  0x00001000  0x00000000
> > > FIS directory     0x407F0000  0x407F0000  0x00010000  0x00000000
> >
> > > eCOS configuration setting is:
> > > FLASH device drivers --> Instantiate in I/O block device API -->
> Name of
> > > flash device 1 block device ("dev/flash1") --> Static
> configuration
> > > selected --> Start offset from flash base (0x00100000); Length
> > (0x00100000).
> >
> > so the jffs is at 0x40100000 to 0x40200000. So, you have no problem
> > here.
> >
> > > But when I run the fileio1 test program I got the following
> errors:
> > >
> > > 1. When the program runs to "mount()"
> > > <4>Write clean marker to block at 0x000e0000 failed: 1
> > > <4>Write clean marker to block at 0x000d0000 failed: 1
> > > <4>Write clean marker to block at 0x000c0000 failed: 1
> > > <4>Write clean marker to block at 0x000b0000 failed: 1
> >
> > My guess is the blocks of flash are locked. I quickly looked to the
> > flash block device and it does nothing about unlocking them. You
> > probably want to write a little program that uses the flash function
> > flash_unloc() to unlock the blocks. Otherwise your jffs can only
> read
> > and not write.
> >
> >     Andrew
> >
> > --
> > Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> > and search the list archive:
> http://sources.redhat.com/ml/ecos-discuss
> --
> Gary D. Thomas <gary.thomas@mind.be>
--
Gary D. Thomas <gary.thomas@mind.be>


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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]