For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU.
This group is to exchange information to help users get started and learn how to use the devices.
Re: Out of RAM? - Caglar Akyuz - Oct 12 3:49:35 2007
axl_dudu wrote:
> Hello! I have been adding some new files to my project and I get the
> following error:
> ----------------
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe:
> region ram is full (rtosdemo.elf section .bss)
> collect2: ld returned 1 exit status
> C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
> ----------------
>
> Do you have any ideea what I should change?
>
Your MCU.
Caglar AKYUZ

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: Out of RAM? - axl_dudu - Oct 12 4:09:12 2007
--- In A...@yahoogroups.com, Caglar Akyuz
wrote:
>
> axl_dudu wrote:
> >
> >
> > Hello! I have been adding some new files to my project and I get
the
> > following error:
> > ----------------
> > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
elf/bin/ld.exe:
> > region ram is full (rtosdemo.elf section .bss)
> > collect2: ld returned 1 exit status
> > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
> > ----------------
> >
> > Do you have any ideea what I should change?
> > Your MCU.
>
> Caglar AKYUZ
>
:)))))...ya...besides that?

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: Out of RAM? - Bernd Walter - Oct 12 4:37:43 2007
On Fri, Oct 12, 2007 at 07:55:38AM -0000, axl_dudu wrote:
> --- In A...@yahoogroups.com, Caglar Akyuz
wrote:
> >
> > axl_dudu wrote:
> > >
> > >
> > > Hello! I have been adding some new files to my project and I get
> the
> > > following error:
> > > ----------------
> > > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
> elf/bin/ld.exe:
> > > region ram is full (rtosdemo.elf section .bss)
> > > collect2: ld returned 1 exit status
> > > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
> > > ----------------
> > >
> > > Do you have any ideea what I should change?
> > >
> >
> > Your MCU.
> >
> > Caglar AKYUZ
> >
> :)))))...ya...besides that?
Reduce configTOTAL_HEAP_SIZE in your config to free enough memory
for your remaining code.
Be carefull - I've started with the lwIP_Demo_Rowley_ARM7 and it had
an error in the the linker-script, which forgot about the system stack,
so the linker does not warn you when already allocating inside the
stack.
I have
ram : ORIGIN = 0x00200000, LENGTH = 64K - 3K
in my atmel-rom.ld to let the linker warn me.
Maybe 3k is too conservative and less is required, but I wanted to
be absolutely save.
--
B.Walter http://www.bwct.de http://www.fizon.de
b...@bwct.de i...@bwct.de s...@fizon.de

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: Out of RAM? - Pietro Maggi - Oct 12 4:41:10 2007
2007/10/12, axl_dudu
:
> > >
> > > Do you have any ideea what I should change?
> > >
> >
> > Your MCU.
> >
> > Caglar AKYUZ
> >
> :)))))...ya...besides that?
>
Well at least give us some info to work on.
Like , which micro are you using, compiler setup and linker setup.
Are you using large buffers in your app?
Best regards
Pietro

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: Out of RAM? - Caglar Akyuz - Oct 12 4:46:13 2007
axl_dudu wrote:
> --- In A...@yahoogroups.com
,
> Caglar Akyuz wrote:
>>
>> axl_dudu wrote:
>> >
>> >
>> > Hello! I have been adding some new files to my project and I get
> the
>> > following error:
>> > ----------------
>> > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
> elf/bin/ld.exe:
>> > region ram is full (rtosdemo.elf section .bss)
>> > collect2: ld returned 1 exit status
>> > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
>> > ----------------
>> >
>> > Do you have any ideea what I should change?
>> >
>>
>> Your MCU.
>>
>> Caglar AKYUZ
>>
> :)))))...ya...besides that?
>
Besides that you may try reducing the code size. You're out of ram, so
there MAY not be anything to do other than reducing the memory usage.
First of all, you can check your memory usage looking at the map file.
To generate a map file you may pass "-M,-Map=outpuf_file" options to
your linker(or to gcc with a -Xlinker option)
In your map file you should look for a entry like "PROVIDE (end, .)".
For instance, in my map file:
...
0x0020fa18 PROVIDE (end, .)
...
This is the end of my ram region. This means that I'm using 64024 bytes
of my ram(SAM7X256 has 64k sram). In your case, this value should exceed
your available sram. If this value is not so big, I mean if you are not
exceeding your memory too much, lets say 10k, then you can optimize your
code(if it has not yet).
To optimize your code you can pass -On (possibly -O3) to your compiler.
If optimization does not help, you should remove some code. Again by
looking into map file, you should see which part of the program consumes
most of your memory.
Regards,
Caglar AKYUZ

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: Out of RAM? - Caglar Akyuz - Oct 12 4:53:39 2007
Bernd Walter wrote:
> On Fri, Oct 12, 2007 at 07:55:38AM -0000, axl_dudu wrote:
>> --- In A...@yahoogroups.com
,
> Caglar Akyuz wrote:
>> >
>> > axl_dudu wrote:
>> > >
>> > >
>> > > Hello! I have been adding some new files to my project and I get
>> the
>> > > following error:
>> > > ----------------
>> > > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
>> elf/bin/ld.exe:
>> > > region ram is full (rtosdemo.elf section .bss)
>> > > collect2: ld returned 1 exit status
>> > > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
>> > > ----------------
>> > >
>> > > Do you have any ideea what I should change?
>> > >
>> >
>> > Your MCU.
>> >
>> > Caglar AKYUZ
>> >
>> :)))))...ya...besides that?
>
> Reduce configTOTAL_HEAP_SIZE in your config to free enough memory
> for your remaining code.
After playing with your configTOTAL_HEAP size, you may try reducing LWiP
memory footprint.
FreeRTOS demo uses LWiP for Ethernet communication. LWiP consumes a lot
ram for tcp buffers, you may try decreasing those. In the file
lwipopts.h there is two options of primary interest. You can try
decreasing these values. However, these are also determines your
ethernet throughput.
#define PBUF_POOL_SIZE
#define PBUF_POOL_BUFSIZE
> Be carefull - I've started with the lwIP_Demo_Rowley_ARM7 and it had
> an error in the the linker-script, which forgot about the system stack,
> so the linker does not warn you when already allocating inside the
> stack.
> I have
> ram : ORIGIN = 0x00200000, LENGTH = 64K - 3K
> in my atmel-rom.ld to let the linker warn me.
> Maybe 3k is too conservative and less is required, but I wanted to
> be absolutely save.
>
That's a good point which I should change in my projects, also.

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Out of RAM? - axl_dudu - Oct 12 4:59:40 2007
My map file says
0x00218648 PROVIDE (end, .)
(99912 bytes)
So I am waaaay over the limit. It is the lwIP part as I noticed that
by removing it everything is ok. But this is by experimenting, and I
don't like it. Please tell me how can I tell that from the map file,
and other things I cand discover from the map file.
Thanks a lot,
Tudor
--- In A...@yahoogroups.com, Caglar Akyuz
wrote:
>
> axl_dudu wrote:
> >
> >
> > --- In A...@yahoogroups.com
40yahoogroups.com>,
> > Caglar Akyuz wrote:
> >>
> >> axl_dudu wrote:
> >> >
> >> >
> >> > Hello! I have been adding some new files to my project and I
get
> > the
> >> > following error:
> >> > ----------------
> >> > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
> > elf/bin/ld.exe:
> >> > region ram is full (rtosdemo.elf section .bss)
> >> > collect2: ld returned 1 exit status
> >> > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
> >> > ----------------
> >> >
> >> > Do you have any ideea what I should change?
> >> >
> >>
> >> Your MCU.
> >>
> >> Caglar AKYUZ
> >>
> > :)))))...ya...besides that?
> > Besides that you may try reducing the code size. You're out of
ram, so
> there MAY not be anything to do other than reducing the memory
usage.
>
> First of all, you can check your memory usage looking at the map
file.
> To generate a map file you may pass "-M,-Map=outpuf_file" options
to
> your linker(or to gcc with a -Xlinker option)
>
> In your map file you should look for a entry like "PROVIDE
(end, .)".
> For instance, in my map file:
>
> ...
> 0x0020fa18 PROVIDE (end, .)
> ...
>
> This is the end of my ram region. This means that I'm using 64024
bytes
> of my ram(SAM7X256 has 64k sram). In your case, this value should
exceed
> your available sram. If this value is not so big, I mean if you
are not
> exceeding your memory too much, lets say 10k, then you can
optimize your
> code(if it has not yet).
>
> To optimize your code you can pass -On (possibly -O3) to your
compiler.
>
> If optimization does not help, you should remove some code. Again
by
> looking into map file, you should see which part of the program
consumes
> most of your memory.
>
> Regards,
> Caglar AKYUZ
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: Out of RAM? - Caglar Akyuz - Oct 12 5:41:18 2007
axl_dudu wrote:
> My map file says
> 0x00218648 PROVIDE (end, .)
>
> (99912 bytes)
> So I am waaaay over the limit. It is the lwIP part as I noticed that
> by removing it everything is ok. But this is by experimenting, and I
> don't like it. Please tell me how can I tell that from the map file,
> and other things I cand discover from the map file.
>
You should check your newly added files. They seem to consume ~30k sram
which is is serious amount of memory for a code to run on SAM7X. I guess
it may be optimized. Please keep in mind that significant amount of
memory is needed for ethernet code if you want it work reliably and need
some performance.

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: Out of RAM? - axl_dudu - Oct 12 5:50:20 2007
--- In A...@yahoogroups.com, Caglar Akyuz
wrote:
>
> axl_dudu wrote:
> >
> >
> > My map file says
> > 0x00218648 PROVIDE (end, .)
> >
> > (99912 bytes)
> > So I am waaaay over the limit. It is the lwIP part as I noticed
that
> > by removing it everything is ok. But this is by experimenting,
and I
> > don't like it. Please tell me how can I tell that from the map
file,
> > and other things I cand discover from the map file.
> > You should check your newly added files. They seem to consume ~30k
sram
> which is is serious amount of memory for a code to run on SAM7X. I
guess
> it may be optimized. Please keep in mind that significant amount of
> memory is needed for ethernet code if you want it work reliably
and need
> some performance.
>
Ok. Thanks a lot for your help! I will try to change some of the
things you told me.
Tudor

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Out of RAM? - axl_dudu - Oct 12 11:40:37 2007
I am using an AT91SAM7X256. It is running the FreeRTOS along with
David Lynch LCD driver and some simple drivers, some of them from
the distribution of the FreeRTOS. The compiler is the WinARM GCC,
and the linker flags:
-Xlinker -ortosdemo.elf -Xlinker -M -Xlinker -Map=rtosdemo.map
The ld script is the atmel-rom.ld
I don't know if this is what you have asked for, but if not please
tell me.
Thanks.
--- In A...@yahoogroups.com, "Pietro Maggi"
wrote:
>
> 2007/10/12, axl_dudu :
> > > >
> > > > Do you have any ideea what I should change?
> > > >
> > >
> > > Your MCU.
> > >
> > > Caglar AKYUZ
> > >
> > :)))))...ya...besides that?
> >
> Well at least give us some info to work on.
> Like , which micro are you using, compiler setup and linker setup.
>
> Are you using large buffers in your app?
>
> Best regards
> Pietro
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Out of RAM? - axl_dudu - Oct 13 2:01:38 2007
--- In A...@yahoogroups.com, Caglar Akyuz
wrote:
>
> axl_dudu wrote:
> >
> >
> > --- In A...@yahoogroups.com
40yahoogroups.com>,
> > Caglar Akyuz wrote:
> >>
> >> axl_dudu wrote:
> >> >
> >> >
> >> > Hello! I have been adding some new files to my project and I
get
> > the
> >> > following error:
> >> > ----------------
> >> > c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-
> > elf/bin/ld.exe:
> >> > region ram is full (rtosdemo.elf section .bss)
> >> > collect2: ld returned 1 exit status
> >> > C:\WinARM\utils\bin\make.exe: *** [rtosdemo.elf] Error 1
> >> > ----------------
> >> >
> >> > Do you have any ideea what I should change?
> >> >
> >>
> >> Your MCU.
> >>
> >> Caglar AKYUZ
> >>
> > :)))))...ya...besides that?
> > Besides that you may try reducing the code size. You're out of
ram, so
> there MAY not be anything to do other than reducing the memory
usage.
>
> First of all, you can check your memory usage looking at the map
file.
> To generate a map file you may pass "-M,-Map=outpuf_file" options
to
> your linker(or to gcc with a -Xlinker option)
>
> In your map file you should look for a entry like "PROVIDE
(end, .)".
> For instance, in my map file:
>
> ...
> 0x0020fa18 PROVIDE (end, .)
> ...
>
> This is the end of my ram region. This means that I'm using 64024
bytes
> of my ram(SAM7X256 has 64k sram). In your case, this value should
exceed
> your available sram. If this value is not so big, I mean if you
are not
> exceeding your memory too much, lets say 10k, then you can
optimize your
> code(if it has not yet).
>
> To optimize your code you can pass -On (possibly -O3) to your
compiler.
>
> If optimization does not help, you should remove some code. Again
by
> looking into map file, you should see which part of the program
consumes
> most of your memory.
>
> Regards,
> Caglar AKYUZ
>
I'm sorry if I'll look a bit dumb, but by reducing the code size I
will reduce the RAM consumption and not the FLASH memory size? I
thought the code goes into FLASH, and only some of the vectors go
into RAM.

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )