[En-Nut-Discussion] Problem with Ethernut Startup

Hugo Simon hugo.simon at gmx.de
Mon Jul 7 22:59:37 CEST 2003


Hi,

I again have this problem, but don't know how to reduce the data segment. Do
you think there is a possibility to fix this bug. I only have a very few
initialized variables, I don't know what eats up the data. Maybe the
threads? What about static non initialized array defined inside functions?
Or text constants like puts("Hallo");

May this part of my map file maybe helpfull.

Why there is such a big block between "alwaysdraw" and "commands".
"alwaysdraw" only is a char.
Also the main source file ledmatrix.o has nearly no initialized statics and
eats up so many memory.

Thank you
Thorsten

.data           0x00800060      0x48e load address 0x0000c758
                0x00800060                PROVIDE (__data_start, .)
 *(.data)
 .data          0x00800060      0x1cc ledmatrix.o
 .data          0x0080022c       0x43 led.o
 .data          0x0080026f      0x171 parser.o
                0x0080026f                linecolor
                0x00800270                txtcolor
                0x00800271                alwaysdraw
                0x0080031b                commands
 .data          0x008003e0       0x13 telnet.o
 .data          0x008003f3        0xa ../../lib/gcc/atmega103/nutinit.o
 .data          0x008003fd        0x8
../../lib/gcc/atmega103\libnutos.a(version.o)
 .data          0x00800405       0x23
../../lib/gcc/atmega103\libnutdev.a(uart0.o)
                0x00800405                devUart0
 .data          0x00800428       0x4a
../../lib/gcc/atmega103\libnutdev.a(eth0rtl.o)
                0x00800428                ifn_eth0
                0x0080044f                devEth0
 .data          0x00800472        0x5
../../lib/gcc/atmega103\libnutdev.a(nicrtl.o)
 .data          0x00800477        0x2
../../lib/gcc/atmega103\libnutnet.a(tcpsock.o)
 .data          0x00800479        0x6
../../lib/gcc/atmega103\libnutnet.a(tcpsm.o)
 .data          0x0080047f        0x2
../../lib/gcc/atmega103\libnutnet.a(udpsock.o)
 .data          0x00800481        0x6
../../lib/gcc/atmega103\libnutnet.a(arpcache.o)
 .data          0x00800487        0xe
../../lib/gcc/atmega103\libnutnet.a(ifconfig.o)
 .data          0x00800495       0x10
../../lib/gcc/atmega103\libnutcrtf.a(fopen.o)
                0x00800495                __iob
 .data          0x008004a5       0x49
../../lib/gcc/atmega103\libnutcrtf.a(putff.o)
 *(.gnu.linkonce.d*)
                0x008004ee                . = ALIGN (0x2)
                0x008004ee                _edata = .
                0x008004ee                PROVIDE (__data_end, .)

.bss            0x008004ee      0x8d2
                0x008004ee                PROVIDE (__bss_start, .)
 *(.bss)
 .bss           0x008004ee      0x5de ledmatrix.o
 .bss           0x00800acc        0xd led.o
 .bss           0x00800ad9        0xf parser.o
                0x00800ae1                liney
                0x00800add                txtformat
                0x00800ad9                txtx
                0x00800adb                txty
                0x00800adf                linex
 .bss           0x00800ae8        0x2
../../lib/gcc/atmega103\libnutos.a(devreg.o)
                0x00800ae8                nutDeviceList
 .bss           0x00800aea       0x13
../../lib/gcc/atmega103\libnutos.a(timer.o)
                0x00800aec                nutTimerPool
                0x00800aea                nutTimerList
 .bss           0x00800afd        0x6
../../lib/gcc/atmega103\libnutos.a(thread.o)
                0x00800aff                nutThreadList
                0x00800b01                runQueue
                0x00800afd                runningThread
 .bss           0x00800b03        0x4
../../lib/gcc/atmega103\libnutos.a(heap.o)
                0x00800b03                heapFreeList
                0x00800b05                available
 .bss           0x00800b07      0x21d
../../lib/gcc/atmega103\libnutdev.a(uart0.o)
 .bss           0x00800d24       0x2a
../../lib/gcc/atmega103\libnutdev.a(eth0rtl.o)
 .bss           0x00800d4e        0x3
../../lib/gcc/atmega103\libnutnet.a(tcpsock.o)
                0x00800d4e                tcpSocketList
 .bss           0x00800d51        0x2
../../lib/gcc/atmega103\libnutnet.a(tcpsm.o)
 .bss           0x00800d53        0x2
../../lib/gcc/atmega103\libnutnet.a(udpsock.o)
                0x00800d53                udpSocketList
 .bss           0x00800d55        0x3
../../lib/gcc/atmega103\libnutnet.a(route.o)
                0x00800d55                rteList
 .bss           0x00800d58       0x10
../../lib/gcc/atmega103\libnutnet.a(inet.o)
 .bss           0x00800d68        0x2
../../lib/gcc/atmega103\libnutnet.a(arpcache.o)


----- Original Message -----
From: Harald Kipp <harald.kipp at egnite.de>
To: <en-nut-discussion at egnite.de>
Sent: Tuesday, June 24, 2003 9:03 PM
Subject: Re: [En-Nut-Discussion] Problem with Ethernut Startup


> You can check the .map file.
>
> If globals and local statics are explicitly initialized,
> they are in the data segment, otherwise they belong to bss.
>
> Btw. avoid
>
>     static int bar = 0;
>
> as this will put two bytes in the data segment and waste
> a two byte copy in flash memory for initialization.
>
>     static int bar;
>
> will put the variable in bss, which is automatically cleared
> during initialization.
>
> Harald
>
> At 19:40 24.06.2003 +0200, you wrote:
> > > The short answer is to never use large static structures. Allways use
> > > malloc. Check the MAP file to make sure that the statics are only
taking
> >up
> > > a <3K of SRAM.
> >Sounds a bit stupid, but how do I see the size of statics?  Is it the bss
> >segment?
> >
> >_______________________________________________
> >En-Nut-Discussion mailing list
> >En-Nut-Discussion at egnite.de
> >http://www.egnite.de/mailman/listinfo/en-nut-discussion
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion
>




More information about the En-Nut-Discussion mailing list