AW: [En-Nut-Discussion] Fwd: codesize and mapfile

Robert Hildebrand robert.hildebrand at ims.fhg.de
Wed Nov 12 07:58:14 CET 2003


Hi Rob,

maybe I can give you some hints for reading HEX- an MAP-file, but your
guesses were right in the most places:

>ATMega128 has 128KBytes of Flash memory, organised in 64K x 16 bits,
>resulting in addresses from 0x0000 til 0xFFFF (programcounter is 16 bits so
>0xFFFF is in all ways the highest cell to address). The mapfile (I use the
>WinAVR GNU-toolchain) tells me that my text segment is 0x20000 long (2
times
>0xFFFF but OK, suppose these are bytes iso words). Then I look at the
>addresses where my routines are put. They exceed 0xFFFF (highest address in
>my project is somewhere around 0x00010430). These can't be the addresses
the
>programcounter is getting.

The HEX- and MAP-file addresses are all byte oriented, the flash-addresses
are word-aligned. (Btw you have to mix the AVR and MAP-file adresses when
using the LPM instruction).
Address 0x00010430 would be 0x8218 for the program counter.

The MAP-file places the data segment at address 0x00800060 ++ for separating
the different types of physical memory (eeprom at 0x00810000).

<Then I study my HEX-file and see that this one
>contains a range from 0x0000 till 0xFFFFF (16 bytes per line, so the HEX is
>byte oriented) and then another range from (again) 0x0000 till 0x0BC0.

I have not detected this effect in my MAP-file (I use also WinAVR). The
lines in the MAP-File are not always in linear order. Every line contains
the complete address information, so maybe they are mixed?

Robert


The MegaAVR
-----Ursprungliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Harald Kipp
Gesendet: Dienstag, 11. November 2003 19:41
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] Fwd: codesize and mapfile



>Delivered-To: web2p2 at p15095813.pureserver.info
>Date: Wed, 29 Oct 2003 22:03:26 +0100
>From: "Rob van Lieshout (PragmaLab)"
>Subject: codesize and mapfile
>To: en-nut-discussion at egnite.de
>X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
>Importance: Normal
>
>Hello,
>
>I'm trying to figure out what the codesize of my project is and normally a
>brief glance at the mapfile would be sufficient. However, there are a  few
>(fundamental) things I don't fully understand. I'm sure one of the readers
>of this (fine) mailinglist is able to explain the missing parts to me.
>
>ATMega128 has 128KBytes of Flash memory, organised in 64K x 16 bits,
>resulting in addresses from 0x0000 til 0xFFFF (programcounter is 16 bits so
>0xFFFF is in all ways the highest cell to address). The mapfile (I use the
>WinAVR GNU-toolchain) tells me that my text segment is 0x20000 long (2
times
>0xFFFF but OK, suppose these are bytes iso words). Then I look at the
>addresses where my routines are put. They exceed 0xFFFF (highest address in
>my project is somewhere around 0x00010430). These can't be the addresses
the
>programcounter is getting. Then I study my HEX-file and see that this one
>contains a range from 0x0000 till 0xFFFFF (16 bytes per line, so the HEX is
>byte oriented) and then another range from (again) 0x0000 till 0x0BC0.
>
>What's happening here? My code is perfectly running (also the routines that
>where put on addresses above 0xFFFF, I doublechecked that). I'm sure it has
>something to do with bytes and words, but it's not about odd and even bytes
>in the HEX-file (adresses sshould occur pairwise in that case)
>
>Can somebody explain to me what I'm overlooking (and how to read the
>map-file?)
>
>Thanks!
>
>Rob van Lieshout

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion






More information about the En-Nut-Discussion mailing list