Hello matthias!

Just take one of the 
C:\MSPGCC\msp430\lib\ldscripts\msp430x???.x
files an modify it your way. 

Not forgetting to tell the linker about the new file 
with sth. like "-T $(NAME).lnk"

This is the easy part ... explaining how to edit the ldscript without
insight into the language itself is far more complicated.

Add your lines to the MEMORY bracket. Like:
  irq_handler_ptr (rwx) : ORIGIN = 0x0200,  LENGTH = 0x0002
  IAR_REGDATA(rw)       : ORIGIN = 0x1200,  LENGTH = 0x0400

.. and match up the rest in case of length and start addresses.



In the SECTIONS bracket there are blocks like this

  .irq_handler_ptr :
  {
    . = ALIGN(2);
    *(.irq_handler_ptr)
  }  > irq_handler_ptr



  .IAR_REGDATA  :
  {
    *(.IAR_REGDATA)
    . = ALIGN(2);
    *(.IAR_REGDATA.*)
  }  > IAR_REGDATA

...to be added. 

Maybe you need to move them around a little. Somewhere before the 
block for "vectors" could be a good point.

Generating the mapfile with ld might be a good idea "-Map $(NAME).map"
to verify locations.

More info about this "language" - if you happen to find any - is
welcome.

In general, if your going for flash, try to c&p the vectors block
because this is a section in flash separated from the "test" section.


Regards,
Helmut

Reply via email to