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: flash erase - network stack


On Tue, 2004-11-09 at 06:17, Nicolas Brouard wrote:
> With Per Hebdlom's patch, my application doesn't work better. This patch
> does a cyg_drv_isr_lock/unlock around the six bus cycle operation to erase
> sector.
> I tried with cyg_drv_isr_lock at the beginning of flash_erase_block function
> and cyg_drv_isr_unlock at the end, and it works very well. Of course, I'll
> have a big delay when I ping my application.
> I'm reading the flash data sheet to be more precise in the position of
> cyg_drv_isr_lock/unlock functions.

If there is any chance of executing code from FLASH, I'm afraid that
the "big hammer" is your only choice.

If you were to change to ROMRAM mode for RedBoot, then Per's patch
would probably be sufficient.

> 
> Is it a good way to use cyg_drv_isr_lock/unlock functions to disable
> interrupt during flash erase? Or must I use cyg_interrupt_disable?

They are equivalent.

> 
> -----Original Message-----
> From: Gary Thomas [mailto:gary@mlbassoc.com]
> Sent: Tuesday, November 09, 2004 7:56 AM
> To: Nicolas Brouard
> Cc: eCos Discussion
> Subject: RE: [ECOS] flash erase - network stack
> 
> 
> On Tue, 2004-11-09 at 05:25, Nicolas Brouard wrote:
> > Thank you for this explanation. I understand I can't debug my application
> > while the flash is erased because my Redboot is in the FLASH. But, if I
> > execute my application without debugging it, I think no Redboot code is
> > executing:
> 
> Not necessarily.  Depending on the platform, you may still be executing
> some instructions from FLASH, even without debugging.
> 
> Try disabling interrupts during the FLASH operations to see if it helps.
> 
> >
> > RedBoot> load myapp.srec
> > Using default protocol (TFTP)
> > Entry point: 0x00020000, address range: 0x00020000-0x000895a4
> > RedBoot> go
> > ...etc...
> >
> > I have the same problem when I ping the application.
> >
> > ... Erase from 0x7c3e0000-0x7c6247e4:
> > ........$T04thread:00000003;40:7c017eb0;01:000dc5d4;#24
> >
> > I think this happens because of interrupts and not because RedBoot code
> from
> > Flash is executed. Do you?
> >
> > I will try the patch of Per Hedblom.
> >
> > -----Original Message-----
> > From: Gary Thomas [mailto:gary@mlbassoc.com]
> > Sent: Monday, November 08, 2004 6:43 PM
> > To: Nicolas Brouard
> > Cc: eCos Discussion
> > Subject: RE: [ECOS] flash erase - network stack
> >
> >
> > On Mon, 2004-11-08 at 14:50, Nicolas Brouard wrote:
> > > The code I execute is in RAM.
> > > I can debug my code using RedBoot in FLASH with network debugging.
> > > I put breakpoints in the function ip_input (ip_input.c) and in the
> > function
> > > icmp_input (ip_icmp.c)
> > > I ping my application (not RedBoot). GDB breaks on input and on
> > icmp_input.
> > > I continue step by step then I go to icmp_reflect function, etc...
> > > If I do that during erasing flash, I have a SIGILL signal (Illegal
> > > instruction).
> >
> > Precisely :-)  When you hit a breakpoint, single step or even just print
> > a message, you'll be executing RedBoot from the FLASH.  Once you start
> > the erase, execution is no longer possible and you'll get a trap.
> >
> > The best solution is to run RedBoot in ROMRAM mode - where it never
> > actually executes from FLASH [directly].  An alternative would be to
> > disable interrupts during FLASH operations.
> >
> > >
> > > -----Original Message-----
> > > From: Gary Thomas [mailto:gary@mlbassoc.com]
> > > Sent: Monday, November 08, 2004 4:19 PM
> > > To: Nicolas Brouard
> > > Cc: eCos Discussion
> > > Subject: Re: [ECOS] flash erase - network stack
> > >
> > >
> > > On Mon, 2004-11-08 at 14:12, Nicolas Brouard wrote:
> > > > Hi,
> > > >
> > > > I have a problem with the Ethernet Stack (FreeBSD) during flash
> erasing.
> > > > My board is based on a MPC860. My application initializes the FreeBSD
> > > stack
> > > > and then erases several sectors of flash (2.5 Mo).
> > > > Everything is ok if there is no Ethernet traffic.
> > > > But, if I ping my board during flash erasing, the program scratches
> > > > immediately:
> > > > ... Erase from 0x7c3e0000-0x7c6247e4:
> > > > ........$T04thread:00000003;40:7c017eb0;01:000dc5d4;#24
> > > >
> > > > The flash driver I use is: amd/am29xxxxx variant am29lv640
> > >
> > > It looks like you are trying to use (execute from) the FLASH while
> > > executing the erase.  You don't happen to be using RedBoot in FLASH
> > > with network debugging while running your code, do you?
> > >
> > > --
> > > Gary Thomas <gary@mlbassoc.com>
> > > MLB Associates
> > >
> > >
> > > --
> > > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> > > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> > >
> > --
> > Gary Thomas <gary@mlbassoc.com>
> > MLB Associates
> >
> --
> Gary Thomas <gary@mlbassoc.com>
> MLB Associates
> 
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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


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