31
µTasker general / Link Error
« on: November 25, 2013, 11:05:54 AM »
Hi Mark,
I am using the 52259, and set everything up for 512k memory, but getting a segment overflow flash2 , see my linker file below. Looking at the linker file, below, I have changed the following and want to make sure there will be no issues:
changed:
flash1 (RX) : ORIGIN = 0x00000000, LENGTH = 0x001000
and
flash2 (RX) : ORIGIN = 0x00001020, LENGTH = 0x007EFDC
Many Thanks
Neil
MEMORY
{
flash1 (RX) : ORIGIN = 0x00000000, LENGTH = 0x000400
flashconfig (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000018
flash2 (RX) : ORIGIN = 0x00000420, LENGTH = 0x003FBE0
vectorram(RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
/* usbrram(RWX) : ORIGIN = 0x20000400, LENGTH = 0x00000080
sram (RWX) : ORIGIN = 0x20000480, LENGTH = 0x00007b80 */
sram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x0000FC00
extram (RWX): ORIGIN = 0x2040000, LENGTH = 0x00080000 /* {2} */
ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0
}
SECTIONS
{
.ipsbar : {} > ipsbar
.flash1 :
{
Startup.s (.text)
. = ALIGN(0x10);
} > flash1
.flashconfig :
{
flash_config.s (.text)
} > flashconfig
.flash2 :
{
. = ALIGN(0x10);
*(.text)
. = ALIGN(0x10);
*(.rodata)
___DATA_ROM = .;
} > flash2
.data : AT(___DATA_ROM)
{
___DATA_RAM = . ;
*(.data)
. = ALIGN (0x10);
___DATA_END = .;
__START_SDATA = .;
*(.sdata)
. = ALIGN (0x10);
__END_SDATA = .;
__SDA_BASE = .;
. = ALIGN(0x10);
} > extram // {2}
.bss :
{
. = ALIGN(0x10);
__START_SBSS = .;
*(.sbss)
*(SCOMMON)
__END_SBSS = .;
. = ALIGN(0x10);
__START_BSS = .;
*(.bss)
*(COMMON)
__END_BSS = .;
___BSS_START = __START_SBSS;
___BSS_END = __END_BSS;
. = ALIGN(0x10);
} >> extram // {2}
___FLASH = ADDR(.flash1);
___FLASH_SIZE = 0x00040000;
___SRAM = 0x20000000;
___VECT_SIZE = 0x00000400;
___SRAM_SIZE = 0x00010000;
___VECTOR_RAM = ___SRAM;
___IPSBAR = ADDR(.ipsbar);
/* ___USB_BDT_RAM = ___SRAM + 0x400; */
___INTERNAL_RAM = ___SRAM + ___VECT_SIZE;
__S_romp = 0;
HEAP_SIZE = 0; /* {1} This can be left as zero if only uMalloc is used */
___HEAP_START = .;
___HEAP_END = ___HEAP_START + HEAP_SIZE;
___SP_INIT = ___SRAM + ___SRAM_SIZE;
___PC_INIT = ___FLASH + 0x8;
___heap_addr = ___HEAP_START;
___heap_size = ___HEAP_END - ___HEAP_START ;
__SP_INIT = ___SP_INIT;
}
I am using the 52259, and set everything up for 512k memory, but getting a segment overflow flash2 , see my linker file below. Looking at the linker file, below, I have changed the following and want to make sure there will be no issues:
changed:
flash1 (RX) : ORIGIN = 0x00000000, LENGTH = 0x001000
and
flash2 (RX) : ORIGIN = 0x00001020, LENGTH = 0x007EFDC
Many Thanks
Neil
MEMORY
{
flash1 (RX) : ORIGIN = 0x00000000, LENGTH = 0x000400
flashconfig (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000018
flash2 (RX) : ORIGIN = 0x00000420, LENGTH = 0x003FBE0
vectorram(RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
/* usbrram(RWX) : ORIGIN = 0x20000400, LENGTH = 0x00000080
sram (RWX) : ORIGIN = 0x20000480, LENGTH = 0x00007b80 */
sram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x0000FC00
extram (RWX): ORIGIN = 0x2040000, LENGTH = 0x00080000 /* {2} */
ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0
}
SECTIONS
{
.ipsbar : {} > ipsbar
.flash1 :
{
Startup.s (.text)
. = ALIGN(0x10);
} > flash1
.flashconfig :
{
flash_config.s (.text)
} > flashconfig
.flash2 :
{
. = ALIGN(0x10);
*(.text)
. = ALIGN(0x10);
*(.rodata)
___DATA_ROM = .;
} > flash2
.data : AT(___DATA_ROM)
{
___DATA_RAM = . ;
*(.data)
. = ALIGN (0x10);
___DATA_END = .;
__START_SDATA = .;
*(.sdata)
. = ALIGN (0x10);
__END_SDATA = .;
__SDA_BASE = .;
. = ALIGN(0x10);
} > extram // {2}
.bss :
{
. = ALIGN(0x10);
__START_SBSS = .;
*(.sbss)
*(SCOMMON)
__END_SBSS = .;
. = ALIGN(0x10);
__START_BSS = .;
*(.bss)
*(COMMON)
__END_BSS = .;
___BSS_START = __START_SBSS;
___BSS_END = __END_BSS;
. = ALIGN(0x10);
} >> extram // {2}
___FLASH = ADDR(.flash1);
___FLASH_SIZE = 0x00040000;
___SRAM = 0x20000000;
___VECT_SIZE = 0x00000400;
___SRAM_SIZE = 0x00010000;
___VECTOR_RAM = ___SRAM;
___IPSBAR = ADDR(.ipsbar);
/* ___USB_BDT_RAM = ___SRAM + 0x400; */
___INTERNAL_RAM = ___SRAM + ___VECT_SIZE;
__S_romp = 0;
HEAP_SIZE = 0; /* {1} This can be left as zero if only uMalloc is used */
___HEAP_START = .;
___HEAP_END = ___HEAP_START + HEAP_SIZE;
___SP_INIT = ___SRAM + ___SRAM_SIZE;
___PC_INIT = ___FLASH + 0x8;
___heap_addr = ___HEAP_START;
___heap_size = ___HEAP_END - ___HEAP_START ;
__SP_INIT = ___SP_INIT;
}