This is the mail archive of the ecos-patches@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: Atmel at49xxxx flash programming patch


On Tue, Jun 10, 2003 at 10:09:01AM +0200, Øyvind Harboe wrote:
> The patch below fixes the crash for me when I'm programming
> flash with a Redboot running out of flash. (EB40a).
> 
> AFAICT, the code that waits for a flash write to complete shouldn't
> run out of flash.

Correct! My guess is that you have the optimizer turned off where as
Jani probably had it enabled during testing. With the optimizer
enabled gcc probably inline'd the function so making it part of
flash_erase_block and flash_program_buf and so living in ram. Without
it being inlined, it lives in ROM.

> I've never submitted a patch before and I'm pretty new to eCos,
> so with that in mind, here it is:

Please include a ChangeLog entry next time.  Also please generate a
unified diff patch, by using -u to diff. 

Here is what i just committed.

        Andrew

Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/at49xxxx/current/ChangeLog,v
retrieving revision 1.1
diff -u -r1.1 ChangeLog
--- current/ChangeLog   13 May 2003 18:32:53 -0000      1.1
+++ current/ChangeLog   10 Jun 2003 11:18:03 -0000
@@ -1,3 +1,8 @@
+2003-06-10  Øyvind Harboe  <oyvind.harboe@zylin.com>
+
+       * include/flash_at49xxxx.inl: wait_while_busy needs to be in RAM
+       since its called while the flash is not readable.
+
 2002-07-12  Tim Drury (tdrury@siliconmotorsports.com>
 
        * include/flash_at49xxxx.inl: added support for AT49LV1614
Index: current/include/flash_at49xxxx.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/at49xxxx/current/include/flash_at49xxxx.inl,v
retrieving revision 1.1
diff -u -r1.1 flash_at49xxxx.inl
--- current/include/flash_at49xxxx.inl  13 May 2003 18:32:53 -0000      1.1
+++ current/include/flash_at49xxxx.inl  10 Jun 2003 11:18:03 -0000
@@ -124,7 +124,8 @@
     __attribute__ ((section (".2ram.flash_erase_block")));
 int  flash_program_buf(void* addr, void* data, int len)
     __attribute__ ((section (".2ram.flash_program_buf")));
-
+static int wait_while_busy(int timeout, volatile flash_data_t* addr_ptr)
+    __attribute__ ((section (".2ram.text")));
 
 //----------------------------------------------------------------------------
 // Initialize driver details


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