Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] How to specify the location of an object in memory (GNU)

2005-11-01 by Michel Kuenemann

Hello Tom,

Thank you very much for your tip. I was searching in the wrong direction (as
usual).

Now I think I have found the way I should do this :

1 - In the linker script I declare a section ".iap" that begins at a given
address in the code space.

 /* Beginning of the flash sector where I want to store data with IAP */

  .iap 0x00016000 :
  {
    *(.iap)
  } >CODE

  . = ALIGN(4);

2 - In the C code I write something like :

long star __attribute__ ((section (".iap")));

I guess this will do the thing. I have checked in the map fil that the
address of "star" is 0x00016000.

Regards

Michel Kuenemann


  -----Message d'origine-----
  De : lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com]De la part de
Tom Walsh
  Envoyé : mardi 1 novembre 2005 21:42
  À : lpc2000@yahoogroups.com
  Objet : Re: [lpc2000] How to specify the location of an object in memory
(GNU)


  Tom Walsh wrote:

  >Michel Kuenemann wrote:
  >
  >
  >
  >>Dear LPC2000 Group,
  >>
  >>I am using the KEIL IDE for ARM7 processors with the GNU Cygnus compiler
on
  >>a LPC2106 target. My
  >>problem is that I cannot find in the documentation how to tell the
compiler
  >>to locate an object at a specified place (somwhere in flash memory, for
  >>instance).
  >>
  >>
  >>
  >>
  >>
  >That would be the linker that would do the physical location of things.
  >
  >Compilers build relocatable objects, linkers place those into regions
  >that you specify in the linker file (script).
  >
  >
  >

  Go here: http://www.openhardware.net

  Then under "Documents Lib" select "Absolute Linking with gcc".  In that
  document, look at page 5 to see how things get hardcoded to an absolute
  address.  The document is rather old, I wrote it a number of years ago,
  however, it is still pertinent to what we do today with the linker.

  TomW


  --
  Tom Walsh - WN3L - Embedded Systems Consultant
  http://openhardware.net, http://cyberiansoftware.com
  "Windows? No thanks, I have work to do..."
  ----------------------------------------------------




  SPONSORED LINKS Microprocessor  Microcontrollers  Pic microcontrollers
        8051 microprocessor


----------------------------------------------------------------------------
--
  YAHOO! GROUPS LINKS

    a..  Visit your group "lpc2000" on the web.

    b..  To unsubscribe from this group, send an email to:
     lpc2000-unsubscribe@yahoogroups.com

    c..  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


----------------------------------------------------------------------------
--



[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.