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


I would like to thank you all very much.
I have now something, which is functional.
I will change RedBoot in ROMRAM mode to have better interrupt latency during
flash operations.
Thank you.

Nicolas Brouard

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: Tuesday, November 09, 2004 8:37 AM
To: Nicolas Brouard
Cc: Gary Thomas; Per Hedblom; eCos Discussion
Subject: Re: [ECOS] flash erase - network stack


On Tue, Nov 09, 2004 at 08:17:20AM -0500, 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.

That patch is addressing a different problem. His patch fixes the
problem that the FLASH erase sequence is getting interupted while
performing the six bus cycles needed to start the erase. These cycles
need to be performed within a specified time.

He is running all this code in RAM, so does not have to worry about
interupts after starting the erase when the flash is still
unaccessable. You however do need to worry about this and this is
causing your crash.

> You problem is that 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.

When ever the flash cannot be read to access the normal context, you
need interrupts disabled. ie from the start of the erase until the
erase has completed. Also from the start of a program till it has
completed. Also from the start of reading the device id to the end of
this process.

> 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?

Using the drv functions is the correct way to do
this. cyg_interrupt_disable is part of the kernel, so might not exist
in some eCos configurations. The driver functions always exist.

        Andrew



-- 
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]