Hello,

I am working on a custom bootloader. For the time being I am trying to the main 
code to a higher address and create a custom section to hold the bootloader 
code. 

After modifying the memory.x file in lib/ldscripts/ I have created a new region 
called "bootldr" and moved the "rom" up by 8K to 0x5100:

memory.x :

MEMORY {
  sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010, size 16 */
  peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100, size 240 */
  peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200, size 256 */
  infomem          : ORIGIN = 0x1000, LENGTH = 0x0100 /* END=0x1100, size 256 */
  infod            : ORIGIN = 0x1000, LENGTH = 0x0040 /* END=0x1040, size 64 */
  infoc            : ORIGIN = 0x1040, LENGTH = 0x0040 /* END=0x1080, size 64 */
  infob            : ORIGIN = 0x1080, LENGTH = 0x0040 /* END=0x10c0, size 64 */
  infoa            : ORIGIN = 0x10c0, LENGTH = 0x0040 /* END=0x1100, size 64 */
  ram (wx)         : ORIGIN = 0x1100, LENGTH = 0x2000 /* END=0x3100, size 8K */
  bootldr (rx)     : ORIGIN = 0x3100, LENGTH = 0x2000 /* END=0x5100, size 8K */
  rom (rx)         : ORIGIN = 0x5100, LENGTH = 0xaec0 /* END=0xffc0, size 44736 
*/
  vectors          : ORIGIN = 0xffc0, LENGTH = 0x0040 /* END=0x10000, size 64 */
  far_rom          : ORIGIN = 0x00010000, LENGTH = 0x0000a000 /* 
END=0x0001a000, 
size 40K */
  /* Remaining banks are absent */
  bsl              : ORIGIN = 0x0000, LENGTH = 0x0000
}
REGION_ALIAS("REGION_BOOTLDR", bootldr);
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_FAR_ROM", far_rom);

After reading further I concluded that what I need is a separate section, not 
defining a memory region. But, from there on, everything gets foggy so I would 
need a little help to point me in the right direction: writing a custom linker 
file for msp430 and maybe a small example of such a file.

Thank you,
Alex


------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to