avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Memory Size Report


From: Peter Harrison
Subject: [avr-gcc-list] Memory Size Report
Date: Sun, 05 Feb 2006 20:44:38 +0000
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

I am using the current WinAVR 20060125

A program compiled with this shows a memory usage report in the compiler output stream. It looks like this:

AVR Memory Usage
----------------
Device: atmega32

Program:   24392 bytes (74.4% Full)
(.text + .data + .bootloader)

Data:       2733 bytes (133.4% Full)
(.data + .bss + .noinit)


My first question is why the .data segment shows as being counted twice. Does this represent the code space needed to store the initial values as well as the RAM space they will take up?

When I look at the map file I see these lines for the .data section:

.data           0x00800060      0x4ec load address 0x00005a5c
                0x00800060                PROVIDE (__data_start, .)
 *(.data)
 .data          0x00800060      0x141 gnumaximus.o
                0x00800060                menusize
 .data          0x008001a1        0xb maze.o
 .data          0x008001ac        0x2 motors.o
                0x008001ac                wallTrackRight
                0x008001ad                wallTrackLeft
 .data          0x008001ae      0x39e setup.o
 *(.gnu.linkonce.d*)
                0x0080054c                . = ALIGN (0x2)
                0x0080054c                _edata = .
                0x0080054c                PROVIDE (__data_end, .)

If I take out some lines with static strings (like sprintf("blah") lines), both the amount of RAM used and the size of the .data section decrease. These strings only need exist in flash memory so what can I do? Why do they seem to be counted twice and where are they really stored?


Pete Harrison







reply via email to

[Prev in Thread] Current Thread [Next in Thread]