Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] embarrassing question

2006-02-07 by Tom Walsh

G B wrote:

>Hello,
>
>I have been doing assembly so long, that I am having trouble with
>my C program.
>
>I have records of 64 bytes in length, and the start of the record area
>must start on an even 0x0100 boundary in ram.
>
>  
>
Depends on the dev system you are using,  I suspect that the modified 
Keil compiler / linker will let you assign a hard address to a function 
with their 'AT' directive.  However, us lessor folk have to be content 
with simply editing the linker script and manually entering where that 
file is to be placed.

Something like this would take my pll_start.o and place it onto a 256 
byte boundry:

============= begin LPC2138ROM.LD ==================
SECTIONS
{
  /* first section is .text which is used for code */
  .text :
  {
    *crt0.o (.text)            /* Startup code */
    . = ALIGN(256);
    system/pll_start.o (.text)
    *(.text)                   /* remaining code */
    *(.rodata)                 /* read-only data (constants) */
    *(.rodata*)
    *(.glue_7)
    *(.glue_7t)
  } > ROM

  . = ALIGN(4);
  _etext = . ;
================== snip ================

The downside is that the gap between crt0.o and the start of the boundry 
is filled will empty space, the linker doesn't recover that area.

Regards,


TomW



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

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.