public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Using flash memory on AT91eb55
@ 2007-12-13 16:03 Champion Jérôme
  2007-12-13 18:23 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Champion Jérôme @ 2007-12-13 16:03 UTC (permalink / raw)
  To: ecos-discuss

Hi, 
I'm make a software with the Linux Synthetic Target for some month.
Now, I want to port it the the evaluation board AT91EB55.
But when I compile it, I've got an error like : "the address 0x2040024 from a.out of the section .bss is not in the region ram".
I've seen that it was an arry wich is too big and which certainly do not fit in the 256ko ram of the board.
I would like to use the flash memory to store this array, but I don't how how to define it.
Have you got any link or tips where to search ?
 
Thanks 
 
Jérôme Champion

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Using flash memory on AT91eb55
  2007-12-13 16:03 [ECOS] Using flash memory on AT91eb55 Champion Jérôme
@ 2007-12-13 18:23 ` Andrew Lunn
  2007-12-14 11:29   ` [ECOS] RE : " Champion Jérôme
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2007-12-13 18:23 UTC (permalink / raw)
  To: Champion J?r?me; +Cc: ecos-discuss

On Thu, Dec 13, 2007 at 04:24:09PM +0100, Champion J?r?me wrote:
> Hi, 
> I'm make a software with the Linux Synthetic Target for some month.
> Now, I want to port it the the evaluation board AT91EB55.
> But when I compile it, I've got an error like : "the address 0x2040024 from a.out of the section .bss is not in the region ram".
> I've seen that it was an arry wich is too big and which certainly do not fit in the 256ko ram of the board.
> I would like to use the flash memory to store this array, but I don't how how to define it.
> Have you got any link or tips where to search ?

Are you using a RAM image or a ROM image? 

A ROM image will run from ROM. All constant data should remain in the
flash. So maybe all you need to do is add a const keyword in the right
place.

If you have a RAM image, it is harder. What i would suggest is remove
the array from the sources and find another way to generate it as
binary data. You can then write this into flash at a well know
address. In your application just use the well known address as a
pointer.

        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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ECOS] RE : [ECOS] Using flash memory on AT91eb55
  2007-12-13 18:23 ` Andrew Lunn
@ 2007-12-14 11:29   ` Champion Jérôme
  2007-12-14 13:07     ` [ECOS] " Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Champion Jérôme @ 2007-12-14 11:29 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

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?

thanks !

Jérôme Champion

-------- Message d'origine--------
De: Andrew Lunn [mailto:andrew@lunn.ch]
Date: jeu. 13/12/2007 16:42
À: Champion Jérôme
Cc: ecos-discuss@sourceware.org
Objet : Re: [ECOS] Using flash memory on AT91eb55
 
On Thu, Dec 13, 2007 at 04:24:09PM +0100, Champion J?r?me wrote:
> Hi, 
> I'm make a software with the Linux Synthetic Target for some month.
> Now, I want to port it the the evaluation board AT91EB55.
> But when I compile it, I've got an error like : "the address 0x2040024 from a.out of the section .bss is not in the region ram".
> I've seen that it was an arry wich is too big and which certainly do not fit in the 256ko ram of the board.
> I would like to use the flash memory to store this array, but I don't how how to define it.
> Have you got any link or tips where to search ?

Are you using a RAM image or a ROM image? 

A ROM image will run from ROM. All constant data should remain in the
flash. So maybe all you need to do is add a const keyword in the right
place.

If you have a RAM image, it is harder. What i would suggest is remove
the array from the sources and find another way to generate it as
binary data. You can then write this into flash at a well know
address. In your application just use the well known address as a
pointer.

        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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55
  2007-12-14 11:29   ` [ECOS] RE : " Champion Jérôme
@ 2007-12-14 13:07     ` Andrew Lunn
  2007-12-14 16:41       ` hong zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2007-12-14 13:07 UTC (permalink / raw)
  To: Champion J?r?me; +Cc: Andrew Lunn, ecos-discuss

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55
  2007-12-14 13:07     ` [ECOS] " Andrew Lunn
@ 2007-12-14 16:41       ` hong zhang
  2007-12-14 22:34         ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: hong zhang @ 2007-12-14 16:41 UTC (permalink / raw)
  To: Andrew Lunn, Champion J?r?me; +Cc: Andrew Lunn, ecos-discuss

Andrew,

How to identify my linux kernel image and ramdisk
image (rootfs) are ROM or RAM images?

----henry

--- Andrew Lunn <andrew@lunn.ch> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55
  2007-12-14 16:41       ` hong zhang
@ 2007-12-14 22:34         ` Andrew Lunn
  2007-12-17  7:55           ` hong zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2007-12-14 22:34 UTC (permalink / raw)
  To: hong zhang; +Cc: Andrew Lunn, Champion J?r?me, ecos-discuss

On Fri, Dec 14, 2007 at 08:21:06AM -0800, hong zhang wrote:
> Andrew,
> 
> How to identify my linux kernel image and ramdisk

Linux? Who said anything about Linux? Im talking about eCos here.

       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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55
  2007-12-14 22:34         ` Andrew Lunn
@ 2007-12-17  7:55           ` hong zhang
  2007-12-17  8:06             ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: hong zhang @ 2007-12-17  7:55 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Andrew,

Sorry. I should say how to identify an image is ROM or
RAM image.

---henry

--- Andrew Lunn <andrew@lunn.ch> wrote:

> On Fri, Dec 14, 2007 at 08:21:06AM -0800, hong zhang
> wrote:
> > Andrew,
> > 
> > How to identify my linux kernel image and ramdisk
> 
> Linux? Who said anything about Linux? Im talking
> about eCos here.
> 
>        Andrew
> 



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Using flash memory on AT91eb55
  2007-12-17  7:55           ` hong zhang
@ 2007-12-17  8:06             ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2007-12-17  8:06 UTC (permalink / raw)
  To: hong zhang; +Cc: Andrew Lunn, ecos-discuss

On Fri, Dec 14, 2007 at 10:10:04AM -0800, hong zhang wrote:
> Andrew,
> 
> Sorry. I should say how to identify an image is ROM or
> RAM image.

Check the value of CYG_HAL_STARTUP.

      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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-12-14 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-13 16:03 [ECOS] Using flash memory on AT91eb55 Champion Jérôme
2007-12-13 18:23 ` Andrew Lunn
2007-12-14 11:29   ` [ECOS] RE : " Champion Jérôme
2007-12-14 13:07     ` [ECOS] " Andrew Lunn
2007-12-14 16:41       ` hong zhang
2007-12-14 22:34         ` Andrew Lunn
2007-12-17  7:55           ` hong zhang
2007-12-17  8:06             ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).