|
|
|
@ -3,9 +3,10 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
OUTPUT_ARCH("24FJ128GA010")
|
|
|
|
|
EXTERN(__resetPRI)
|
|
|
|
|
EXTERN(__resetALT)
|
|
|
|
|
CRT0_STARTUP(crt0_standard.o)
|
|
|
|
|
CRT1_STARTUP(crt1_standard.o)
|
|
|
|
|
|
|
|
|
|
OPTIONAL(-lpPIC24Fxxx)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** Memory Regions
|
|
|
|
@ -20,6 +21,10 @@ MEMORY
|
|
|
|
|
config2 : ORIGIN = 0x157FC, LENGTH = 0x2
|
|
|
|
|
config1 : ORIGIN = 0x157FE, LENGTH = 0x2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__CONFIG2 = 0x157FC;
|
|
|
|
|
__CONFIG1 = 0x157FE;
|
|
|
|
|
|
|
|
|
|
__IVT_BASE = 0x4;
|
|
|
|
|
__AIVT_BASE = 0x104;
|
|
|
|
|
__DATA_BASE = 0x800;
|
|
|
|
@ -59,16 +64,65 @@ SECTIONS
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** User Code and Library Code
|
|
|
|
|
**
|
|
|
|
|
** This section must not be assigned to __CODE_BASE,
|
|
|
|
|
** because CodeGuard(tm) sections may be located there.
|
|
|
|
|
**
|
|
|
|
|
** Note that input sections *(.text) are not mapped here.
|
|
|
|
|
** The best-fit allocator locates them, so that .text
|
|
|
|
|
** may flow around PSV sections as needed.
|
|
|
|
|
*/
|
|
|
|
|
.text __CODE_BASE :
|
|
|
|
|
.text :
|
|
|
|
|
{
|
|
|
|
|
*(.init);
|
|
|
|
|
*(.user_init);
|
|
|
|
|
*(.handle);
|
|
|
|
|
*(.libc) *(.libm) *(.libdsp); /* keep together in this order */
|
|
|
|
|
*(.lib*);
|
|
|
|
|
*(.text);
|
|
|
|
|
} >program
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** User-Defined Section in Program Memory
|
|
|
|
|
**
|
|
|
|
|
** note: can specify an address using
|
|
|
|
|
** the following syntax:
|
|
|
|
|
**
|
|
|
|
|
** usercode 0x1234 :
|
|
|
|
|
** {
|
|
|
|
|
** *(usercode);
|
|
|
|
|
** } >program
|
|
|
|
|
*/
|
|
|
|
|
usercode :
|
|
|
|
|
{
|
|
|
|
|
*(usercode);
|
|
|
|
|
} >program
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** User-Defined Constants in Program Memory
|
|
|
|
|
**
|
|
|
|
|
** For PSV type sections, the Load Memory Address (LMA)
|
|
|
|
|
** should be specified as follows:
|
|
|
|
|
**
|
|
|
|
|
** userconst : AT(0x1234)
|
|
|
|
|
** {
|
|
|
|
|
** *(userconst);
|
|
|
|
|
** } >program
|
|
|
|
|
**
|
|
|
|
|
** Note that mapping PSV sections in linker scripts
|
|
|
|
|
** is not generally recommended.
|
|
|
|
|
**
|
|
|
|
|
** Because of page alignment restrictions, memory is
|
|
|
|
|
** often used more efficiently when PSV sections
|
|
|
|
|
** do not appear in the linker script.
|
|
|
|
|
**
|
|
|
|
|
** For more information on memory allocation,
|
|
|
|
|
** please refer to chapter 10, 'Linker Processing'
|
|
|
|
|
** in the Assembler, Linker manual (DS51317).
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
** Configuration Words
|
|
|
|
|
*/
|
|
|
|
@ -184,7 +238,7 @@ SECTIONS
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt));
|
|
|
|
|
LONG( DEFINED(__SPI1ErrInterrupt) ? ABSOLUTE(__SPI1ErrInterrupt) :
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt));
|
|
|
|
|
LONG( DEFINED(__SPI1TInterrupt) ? ABSOLUTE(__SPI1TInterrupt) :
|
|
|
|
|
LONG( DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt));
|
|
|
|
|
LONG( DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt));
|
|
|
|
@ -463,8 +517,8 @@ SECTIONS
|
|
|
|
|
LONG( DEFINED(__AltSPI1ErrInterrupt) ? ABSOLUTE(__AltSPI1ErrInterrupt) :
|
|
|
|
|
(DEFINED(__SPI1ErrInterrupt) ? ABSOLUTE(__SPI1ErrInterrupt) :
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt)));
|
|
|
|
|
LONG( DEFINED(__AltSPI1TInterrupt) ? ABSOLUTE(__AltSPI1TInterrupt) :
|
|
|
|
|
(DEFINED(__SPI1TInterrupt) ? ABSOLUTE(__SPI1TInterrupt) :
|
|
|
|
|
LONG( DEFINED(__AltSPI1Interrupt) ? ABSOLUTE(__AltSPI1Interrupt) :
|
|
|
|
|
(DEFINED(__SPI1Interrupt) ? ABSOLUTE(__SPI1Interrupt) :
|
|
|
|
|
ABSOLUTE(__DefaultInterrupt)));
|
|
|
|
|
LONG( DEFINED(__AltU1RXInterrupt) ? ABSOLUTE(__AltU1RXInterrupt) :
|
|
|
|
|
(DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) :
|
|
|
|
@ -1247,15 +1301,16 @@ _PMADDR = 0x604;
|
|
|
|
|
_PMADDRbits = 0x604;
|
|
|
|
|
PMDOUT1 = 0x604;
|
|
|
|
|
_PMDOUT1 = 0x604;
|
|
|
|
|
_PMDOUT1bits = 0x604;
|
|
|
|
|
PMDOUT2 = 0x606;
|
|
|
|
|
_PMDOUT2 = 0x606;
|
|
|
|
|
PMDIN1 = 0x608;
|
|
|
|
|
_PMDIN1 = 0x608;
|
|
|
|
|
PMDIN2 = 0x60A;
|
|
|
|
|
_PMDIN2 = 0x60A;
|
|
|
|
|
PMPEN = 0x60C;
|
|
|
|
|
_PMPEN = 0x60C;
|
|
|
|
|
_PMPENbits = 0x60C;
|
|
|
|
|
PMAEN = 0x60C;
|
|
|
|
|
_PMAEN = 0x60C;
|
|
|
|
|
_PMAENbits = 0x60C;
|
|
|
|
|
PMSTAT = 0x60E;
|
|
|
|
|
_PMSTAT = 0x60E;
|
|
|
|
|
_PMSTATbits = 0x60E;
|
|
|
|
@ -1280,6 +1335,7 @@ _CRCCON = 0x640;
|
|
|
|
|
_CRCCONbits = 0x640;
|
|
|
|
|
CRCXOR = 0x642;
|
|
|
|
|
_CRCXOR = 0x642;
|
|
|
|
|
_CRCXORbits = 0x642;
|
|
|
|
|
CRCDAT = 0x644;
|
|
|
|
|
_CRCDAT = 0x644;
|
|
|
|
|
CRCWDAT = 0x646;
|
|
|
|
@ -1311,6 +1367,10 @@ _RCONbits = 0x740;
|
|
|
|
|
OSCCON = 0x742;
|
|
|
|
|
_OSCCON = 0x742;
|
|
|
|
|
_OSCCONbits = 0x742;
|
|
|
|
|
OSCCONL = 0x742;
|
|
|
|
|
_OSCCONL = 0x742;
|
|
|
|
|
OSCCONH = 0x743;
|
|
|
|
|
_OSCCONH = 0x743;
|
|
|
|
|
CLKDIV = 0x744;
|
|
|
|
|
_CLKDIV = 0x744;
|
|
|
|
|
_CLKDIVbits = 0x744;
|
|
|
|
@ -1331,3 +1391,35 @@ _PMD2bits = 0x772;
|
|
|
|
|
PMD3 = 0x774;
|
|
|
|
|
_PMD3 = 0x774;
|
|
|
|
|
_PMD3bits = 0x774;
|
|
|
|
|
/*
|
|
|
|
|
** ======= Base Addresses for Various Peripherals ======
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
IC1 = 0x140;
|
|
|
|
|
_IC1 = 0x140;
|
|
|
|
|
IC2 = 0x144;
|
|
|
|
|
_IC2 = 0x144;
|
|
|
|
|
IC3 = 0x148;
|
|
|
|
|
_IC3 = 0x148;
|
|
|
|
|
IC4 = 0x14C;
|
|
|
|
|
_IC4 = 0x14C;
|
|
|
|
|
IC5 = 0x150;
|
|
|
|
|
_IC5 = 0x150;
|
|
|
|
|
OC1 = 0x180;
|
|
|
|
|
_OC1 = 0x180;
|
|
|
|
|
OC2 = 0x186;
|
|
|
|
|
_OC2 = 0x186;
|
|
|
|
|
OC3 = 0x18C;
|
|
|
|
|
_OC3 = 0x18C;
|
|
|
|
|
OC4 = 0x192;
|
|
|
|
|
_OC4 = 0x192;
|
|
|
|
|
OC5 = 0x198;
|
|
|
|
|
_OC5 = 0x198;
|
|
|
|
|
SPI1 = 0x240;
|
|
|
|
|
_SPI1 = 0x240;
|
|
|
|
|
SPI2 = 0x260;
|
|
|
|
|
_SPI2 = 0x260;
|
|
|
|
|
UART1 = 0x220;
|
|
|
|
|
_UART1 = 0x220;
|
|
|
|
|
UART2 = 0x230;
|
|
|
|
|
_UART2 = 0x230;
|
|
|
|
|