ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
27 сентября
1041 Топик полностью
undefined (15.12.2003 10:24, просмотров: 1) ответил KoнcтaнтинT на To undefined не могу LPC2104 отладить из под MULTI, пихает куда то сегмент .text. не поделитесь рабочм файлом линкера?
А вот этим - в ОЗУ отлаживаться 

//*************************************************************************
// -------------
// Code segments - No code segment may exceed 4/32 Mbytes in size.
// -------------
//
// INTVEC -- Exception vector table.
// SWITAB -- Software interrupt vector table.
// ICODE -- Startup (cstartup) and exception code.
// DIFUNCT -- Dynamic initialization vectors used by EC++.
// NEARFUNC_x -- Functions with attribute __nearfunc.
// All parts of a Thumb code segment of this type must be
// placed within the same 4 Mbyte area.
// For Arm code, the limit is 32 Mbytes.
// FARFUNC_x -- Functions with attribute __farfunc. These segments may
// be placed anywhere in memory.
//
// Where _x can be one of:
//
// _T -- Thumb code (ROM).
// _T_I -- Thumb code that executes in RAM, initialized by T_ID.
// _T_ID -- Initializer for T_I (ROM).
// _A -- ARM code (ROM).
// _A_I -- ARM code that executes in RAM, initialized by A_ID.
// _A_ID -- Initializer for A_I (ROM).
//
// -------------
// Data segments - may be placed anywhere in memory.
// -------------
//
// CSTACK -- The stack used by C/EC++ programs (user mode).
// IRQ_STACK -- The stack used by IRQ service routines.
// SVC_STACK -- The stack used in supervisor mode
// (Define other exception stacks as needed for
// FIQ, ABT, UND, SYS).
// HEAP -- The heap used by malloc and free in C and new and
// delete in EC++.
// INITTAB -- Table containing addresses and sizes of segments that
// need to be initialized at startup (by cstartup).
// CHECKSUM -- The linker places checksum byte(s) in this segment,
// when the -J linker command line option is used.
// HUGE_y -- Objects with the __huge memory attribute (default).
//
// Where _y can be one of:
//
// _AN -- Holds uninitialized located objects, i.e. objects with
// an absolute location given by the @ operator or the
// #pragma location directive. Since these segments
// contain objects which already have a fixed address,
// they should not be mentioned in this linker command
// file.
// _C -- Constants (ROM).
// _I -- Initialized data (RAM).
// _ID -- The original content of _I (copied to _I by cstartup) (ROM).
// _N -- Uninitialized data (RAM).
// _Z -- Zero initialized data (RAM).
//
//*************************************************************************

-carm

//*************************************************************************
// Segment placement - General information
//
// All numbers in the segment placement command lines below are interpreted
// as hexadecimal unless they are immediately preceded by a '.', which
// denotes decimal notation.
//
// When specifying the segment placement using the -P instead of the -Z
// option, the linker is free to split each segment into its segment parts
// and randomly place these parts within the given ranges in order to
// achieve a more efficient memory usage. One disadvantage, however, is
// that it is not possible to find the start or end address (using
// the assembler operators .sfb./.sfe.) of a segment which has been split
// and reformed.
//
// When generating an output file which is to be used for programming
// external ROM/Flash devices, the -M linker option is very useful
// (see xlink.pdf for details).
//*************************************************************************


//*************************************************************************
// Read-only segments mapped to RAM.
//*************************************************************************

-DROMSTART=40000040
-DROMEND=40009FFF

//************************************************
// 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=40000000-4000003F

//************************************************
// Startup code and exception routines (ICODE).
//************************************************

-Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND
-Z(CODE)SWITAB=ROMSTART-ROMEND

//************************************************
// Far code segments may be placed anywhere, but
// all __nearfunc declared Thumb/ARM functions,
// located in the NEARFUNC_T/NEARFUNC_A segment,
// must fit in a single 4/32 Mbyte area.
//************************************************

-Z(CODE)NEARFUNC_T,NEARFUNC_A=ROMSTART-ROMEND
-Z(CODE)FARFUNC_T,FARFUNC_A=ROMSTART-ROMEND

//************************************************
// Original ROM location for __ramfunc code copied
// to and executed from RAM.
//************************************************

-Z(CONST)NEARFUNC_T_ID,NEARFUNC_A_ID=ROMSTART-ROMEND
-Z(CONST)FARFUNC_T_ID,FARFUNC_A_ID=ROMSTART-ROMEND

//************************************************
// Various constants and initializers.
//************************************************

-Z(CONST)INITTAB,HUGE_ID,HUGE_C=ROMSTART-ROMEND
-Z(CONST)CHECKSUM=ROMSTART-ROMEND

//*************************************************************************
// Read/write segments mapped to RAM.
//*************************************************************************

-DRAMSTART=4000A000
-DRAMEND=4000FFFF

//************************************************
// Data segments.
//************************************************

-Z(DATA)HUGE_I,HUGE_Z,HUGE_N=RAMSTART-RAMEND

//************************************************
// __ramfunc code copied to and executed from RAM.
//************************************************

-Z(DATA)NEARFUNC_T_I,NEARFUNC_A_I=RAMSTART-RAMEND
-Z(DATA)FARFUNC_T_I,FARFUNC_A_I=RAMSTART-RAMEND

//************************************************
// ICCARM produces code for __ramfunc functions in
// *_I segments. The -Q XLINK command line option
// redirects XLINK to emit the code in the
// corresponding *_ID segment instead, but to keep
// symbol and debug information associated with
// the *_I segment, where the code will execute.
//************************************************

-QNEARFUNC_T_I=NEARFUNC_T_ID
-QNEARFUNC_A_I=NEARFUNC_A_ID
-QFARFUNC_T_I=FARFUNC_T_ID
-QFARFUNC_A_I=FARFUNC_A_ID

//*************************************************************************
// Stack and heap segments.
//*************************************************************************

-D_CSTACK_SIZE=1000
// -D_SVC_STACK_SIZE=10
-D_IRQ_STACK_SIZE=100
-D_HEAP_SIZE=2000

-Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
// -Z(DATA)SVC_STACK+_SVC_STACK_SIZE=RAMSTART-RAMEND
-Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE,HEAP+_HEAP_SIZE=RAMSTART-RAMEND