[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] file length problem with atmega128
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] file length problem with atmega128 |
Date: |
Mon, 10 Feb 2003 15:31:40 +0100 |
User-agent: |
Mutt/1.2.5i |
As Brian Dean wrote:
> > No, it uses 16884+218=17102 bytes of flash. :-)
>
> Hmmm ... my programmer claims it is uploading 16884 bytes into flash
> when I program the chip. I thought the size of the text section
> reported by 'size' already accounted for initialized data.
Did you perhaps forget to extract both, text and data with objcopy?
Then you won't have initialized data...
address@hidden 1389% cat foo.s
.section .text
rjmp .
.section .data
.byte 42
address@hidden 1390% avr-as -o foo.o foo.s
address@hidden 1391% avr-size foo.o
text data bss dec hex filename
2 1 0 3 3 foo.o
address@hidden 1392% avr-ld -o foo foo.o
address@hidden 1393% avr-size foo
text data bss dec hex filename
2 2 0 4 4 foo
address@hidden 1394% avr-objcopy -O binary foo foo.bin
address@hidden 1395% ls -l foo.bin
-rwxrwxr-x 1 j wheel 4 Feb 10 15:30 foo.bin*
address@hidden 1396% hd foo.bin
00000000 00 c0 2a 00 |..*.|
00000004
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/