From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8630 invoked by alias); 14 Dec 2007 16:21:18 -0000 Received: (qmail 8622 invoked by uid 22791); 14 Dec 2007 16:21:17 -0000 X-Spam-Check-By: sourceware.org Received: from web57914.mail.re3.yahoo.com (HELO web57914.mail.re3.yahoo.com) (68.142.236.107) by sourceware.org (qpsmtpd/0.31) with SMTP; Fri, 14 Dec 2007 16:21:08 +0000 Received: (qmail 70294 invoked by uid 60001); 14 Dec 2007 16:21:06 -0000 X-YMail-OSG: XN6jNy4VM1kKH7xmNFzht2cPpfTsFzDlpT80oF.zI1yE6GzRZ2XopnS1yMBW5kbM8jnUXq7JrtxU8G64mWcr39e13V61AyDe1vp7a5p_0sJSm3rxABMwacRZua_I7CGyP565kuMhLU3C8.Y- Received: from [75.37.34.80] by web57914.mail.re3.yahoo.com via HTTP; Fri, 14 Dec 2007 08:21:06 PST Date: Fri, 14 Dec 2007 16:41:00 -0000 From: hong zhang To: Andrew Lunn , Champion J?r?me Cc: Andrew Lunn , ecos-discuss@sourceware.org In-Reply-To: <20071214112016.GF13033@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <634044.69488.qm@web57914.mail.re3.yahoo.com> X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55 X-SW-Source: 2007-12/txt/msg00089.txt.bz2 Andrew, How to identify my linux kernel image and ramdisk image (rootfs) are ROM or RAM images? ----henry --- Andrew Lunn wrote: > On Fri, Dec 14, 2007 at 11:38:31AM +0100, Champion > J?r?me wrote: > > The evaluation board has 3 memory : > > > > * 256K byte of 16-bit SRAM (upgradeable to 1 MB) > > * 2M bytes of 16-bit Flash (of which 1 MB is > available for user software) > > * 4M bytes of Serial Data Flash (upgradeable to > 16 MB) > > > > As I understand, the 256kb SRAM is used by the > variables in my code. > > > > 1 mb of flash is used by my code which take 900 > kb. > > the other 1mb is used by the bootloader, which > take only 200kb, so I think I can perhaps use the > 800 other. > > So I just have to make a "const char* myArray = > 0x01050000" and the data will go there ? > > > > I can use the 4mb of serial flash, but I don't > really know how to do it. > > > > Why is it revelent if I work in the ram or the > rom, the error happen at compilation time? > > The compilation time error is just saying your don't > have enough > memory. Im assuming here it is saying you don't have > enough RAM, but > it could be saying the flash is too small. > > The difference between a RAM image and a ROM image > is to do with where > the code lives when executed. With a ROM image, the > executable code > stays in ROM, and only your stacks, writable > variables etc are in > RAM. With a RAM image, everything is is RAM, > including the code. > > So a ROM image has the advantage you need less RAM. > The disadvantage > is that often flash is slower to read than RAM, so > your program runs > slower. > > If you have a ROM image, the linker needs to decide > for each variable > where to put it. Does it put it in RAM or in FLASH. > Anything which can > be modified has to be in RAM. Anything which is > constant can be put in > FLASH. So if you declare your array as > > const int foo[4] = { 1, 2, 3, 4}; > > the linker knows it can put it into FLASH. Without > the const, it is > possible your code does something like > > foo[2] = 42; > > and so it needs to be in RAM. > > 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 > > ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss