Additional information: I think also need to change assembler directive
ORG to "ORG 0x4000"
Reply by liew...@kenetics-group.com●September 23, 20082008-09-23
Hi all,
I have a bootloader which is located at flash memory 0x0000 to 0x4000 and ram
memory 0x0000 to 0x2000. The bootloader itself has enabled the remap feature.
Now, I wish to write my application in IAR but I have no idea on how to write my
linker setting (*.xcl). Here is my non-working example. Any expert who can hint
what was wrong? All kind of hints will be greatly appreciated.
//*************************************************************************
// Read/write segments mapped to 64 K RAM.
//*************************************************************************
-DRAMSTART202000
-DRAMEND20FFFF
//************************************************
// Address range for reset and exception
// vectors (INTVEC).
// The vector area is 32 bytes,
// an additional 32 bytes is allocated for the
// constant table used by ldr PC in cstartup.s79.
//************************************************
-Z(CODE)INTVEC 2000-20203F
//************************************************
// Code segments may be placed anywhere.
//************************************************
-Z(CODE)CODE=ROMSTART-ROMEND,ROMSTART2-ROMEND2
//************************************************
// Various constants and initializers.
//************************************************
-Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND,ROMSTART2-ROMEND2
-Z(CONST)CHECKSUM=ROMSTART-ROMEND,ROMSTART2-ROMEND2
//************************************************
// Data segments.
//************************************************
-Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND
//************************************************
// __ramfunc code copied to and executed from RAM.
//************************************************
-Z(DATA)CODE_I=RAMSTART-RAMEND
-Z(CONST)CODE_ID=ROMSTART-ROMEND,ROMSTART2-ROMEND2 // Initializer for
-QCODE_I=CODE_ID
//************************************************
// ICCARM produces code for __ramfunc functions in
// CODE_I segments. The -Q XLINK command line
// option redirects XLINK to emit the code in the
// debug information associated with the CODE_I
// segment, where the code will execute.
//************************************************
//*************************************************************************
// Stack and heap segments. (hex values)
//*************************************************************************
//-D_CSTACK_SIZE=(100*4)
// ASIDSING - made stack 4k (400*4) or 8k(800*4)
-D_CSTACK_SIZE=(400*4)
-D_IRQ_STACK_SIZE=(3*8*4)
-D_ABT_STACK_SIZE0
// ASIDSING note that these stacks are initialized in Cstartup.s79
// and are stuck at the end of RAM
-Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
-Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND
-Z(DATA)ABT_STACK+_ABT_STACK_SIZE=RAMSTART-RAMEND