[En-Nut-Discussion] Problems with size of RAM for static variables

Lars Haack lars.haack at gmx.de
Wed May 14 22:10:21 CEST 2003


Hi,

I added some code to the httpd example in Nut321 and I got some incorrect
behaviour. When I had a look at the mapfile I saw that my .data and .bss
segment exceeded the size of the internal ram. By removing the example
cgi-functions in httpserv.c I was able to reduce the amount of RAM that is
statically allocated by the linker and everything worked fine.
It is documented in the ethernut manuals that you can only use the internal
RAM for variables and stuff, but you do not get an error message if you
accidently excedd the internal RAM. One way to provide a feedback to the
programmer could be to change the LENGTH attribute for the segment data in
the linker script avr5.x.
But on the other hand I ask myself if there is a technical reason for all
this. In my naiveness I always thought that the amount of heap-memory is
derived from the amount of already used RAM. I think NutInit() deals with
that but after having a first look at this function I do not understand
exactly what it does.
Perhaps someone can give me some hints.

Regards
  Lars Haack




More information about the En-Nut-Discussion mailing list