Other Parts Discussed in Thread: MSP430FR5739,
Tool/software: Code Composer Studio
Hi,
We are implementing a custom bootloader for FR2633 series due to non availability of the standard bootloader, during testing we bricked a controller due to few memory overlaps in the linker script. Please find the updated linker script below for the bootloader modified (from MSP430FR5739) as per FR2633 memory mapping. Kindly confirm if the linker script is good. Also would like to know what "BOOT_SHARED_CALLBACKS" is used for ? As per theoritical calculation it should be 0xFF78. Is the a problem in placing it in 0xFF70, just that the next 8 bytes are unused before the start of the BSLsignature & JTAGSignature.
Thank you
With Regards,
Muruga
Bootloader Linker File
/* RAM Memory Addresses */
__RAM_Start = 0x2000; /* RAM Start */
__RAM_End = 0x2FFF; /* RAM End */
/* RAM shared between App and Bootloader, must be reserved */
PassWd = 0x2000; /* Password sent by App to force boot mode */
StatCtrl = 0x2002; /* Status and Control byte used by Comm */
CI_State_Machine = 0x2003; /* State machine variable used by Comm */
CI_Callback_ptr = 0x2004; /* Pointer to Comm callback structure */
/* Unreserved RAM used for Bootloader or App purposes */
_NonReserved_RAM_Start = 0x2006; /* Non-reserved RAM */
/* Flash memory addresses */
__Flash_Start = 0xC400; /* Start of Flash */
__Flash_End = 0xFFFF; /* End of Flash */
/* Reserved Flash locations for Bootloader Area */
__Boot_Start = 0xFA00; /* Boot flash */
__Boot_Reset = 0xFFFE; /* Boot reset vector */
__Boot_VectorTable = 0xFF88; /* Boot vector table */
__Boot_SharedCallbacks_Len = 8; /* Length of shared callbacks (2 calls =4B(msp430) or 8B(msp430x) */
__Boot_SharedCallbacks = 0xFF70; /* Start of Shared callbacks changed from FF80 to FF70 to avoid memoery overlap of JTAG Signature and BSL Signature*/
/* Reserved Flash locations for Application Area */
_AppChecksum = (__Flash_Start); /* CRC16 of Application */
_AppChecksum_8 = (__Flash_Start+2); /* CRC8 of Application */
_App_Start = (__Flash_Start+3); /* Application Area */
_App_End = (__Boot_Start-1); /* End of application area (before boot) */
_CRC_Size = (_App_End - _App_Start +1); /* Number of bytes calculated for CRC */
_App_Reset_Vector = (__Boot_Start-2); /* Address of Application reset vector */
_App_Proxy_Vector_Start = 0xF988; /* CHANGED TO ACCOMODATE 4 MORE VECTORS Proxy interrupt table */
/* MEMORY definition, adjust based on definitions above */
MEMORY
{
SFR : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
// RAM from _NonReserved_RAM_Start - __RAM_End
// Muruga 4K RAM
RAM : origin = 0x2006, length = 0xFFA
// Muruga 512 for 2633
INFOBOOT : origin = 0x1800, length = 0x200
// Flash from __Boot_Start -( __Boot_SharedCallbacks or INT_VECTOR_TABLE)
FLASH : origin = 0xFA00, length = 0x570
// Added by Muruga
JTAGSIGNATURE : origin = 0xFF80, length = 0x0004, fill = 0xFFFF
BSLSIGNATURE : origin = 0xFF84, length = 0x0004, fill = 0xFFFF
// Shared callbacks from __Boot_SharedCallbacks + Len (when used)
BOOT_SHARED_CALLBACKS : origin = 0xFF70, length = 8
// Boot vector Table from __Boot_VectorTable- __Boot_Reset
INT_VECTOR_TABLE : origin = 0xFF88, length = 0x76
// Boot reset from __Boot_Reset-__Flash_End
RESET : origin = 0xFFFE, length = 0x0002
}
/****************************************************************************/
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
/****************************************************************************/
SECTIONS
{
.bss : {} > RAM /* GLOBAL & STATIC VARS */
.data : {} > RAM /* GLOBAL & STATIC VARS */
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */
.text : {} >> FLASH |INFOBOOT /* CODE */
.cinit : {} >> FLASH |INFOBOOT /* INITIALIZATION TABLES*/
.const : {} >> FLASH |INFOBOOT /* CONSTANT DATA */
.cio : {} > RAM /* C I/O BUFFER */
.BOOT_APP_VECTORS : {} > BOOT_SHARED_CALLBACKS
/* MSP430 INTERRUPT VECTORS */
.BOOT_VECTOR_TABLE : {} > INT_VECTOR_TABLE
.reset : {} > RESET /* MSP430 RESET VECTOR */
}
/****************************************************************************/
/* INCLUDE PERIPHERALS MEMORY MAP */
/****************************************************************************/
-l MSP430FR2633.cmd
App Boot Loader
/* RAM Memory Addresses */
__RAM_Start = 0x2000; /* RAM Start */
__RAM_End = 0x2FFF; /* RAM End */
/* RAM shared between App and Bootloader, must be reserved */
PassWd = 0x2000; /* Password sent by App to force boot mode */
StatCtrl = 0x2002; /* Status and Control byte used by Comm */
CI_State_Machine = 0x2003; /* State machine variable used by Comm */
CI_Callback_ptr = 0x2004; /* Pointer to Comm callback structure */
/* Unreserved RAM used for Bootloader or App purposes */
_NonReserved_RAM_Start = 0x2006; /* Non-reserved RAM */
/* Flash memory addresses */
__Flash_Start = 0xC400; /* Start of Flash */
__Flash_End = 0xFFFF; /* End of Flash */
/* Reserved Flash locations for Bootloader Area */
__Boot_Start = 0xFA00; /* Boot flash */
__Boot_Reset = 0xFFFE; /* Boot reset vector */
__Boot_VectorTable = 0xFF88; /* Boot vector table */
__Boot_SharedCallbacks_Len = 8; /* Length of shared callbacks (2 calls =4B(msp430) or 8B(msp430x) */
__Boot_SharedCallbacks = 0xFF70; /* Start of Shared callbacks */
_BOOT_APPVECTOR = __Boot_SharedCallbacks; /* Definition for application table */
/* Reserved Flash locations for Application Area */
_AppChecksum = (__Flash_Start); /* CRC16 of Application */
_AppChecksum_8 = (__Flash_Start+2); /* CRC8 of Application */
_App_Start = (__Flash_Start+3); /* Application Area */
_App_End = (__Boot_Start-1); /* End of application area (before boot) */
_CRC_Size = (_App_End - _App_Start +1); /* Number of bytes calculated for CRC */
_App_Reset_Vector = (__Boot_Start-2); /* FA00 -2 = F9FE Address of Application reset vector */
_App_Proxy_Vector_Start = 0xF988; /* CHANGED TO ACCOMODATE 4 MORE VECTORS Proxy interrupt table */
/* MEMORY definition, adjust based on definitions above */
MEMORY
{
SFR : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
// RAM from _NonReserved_RAM_Start - __RAM_End
// 4K RAM
RAM : origin = 0x2006, length = 0xFFA
// 512 bytes for FR2633
INFOA : origin = 0x1800, length = 0x200
// Flash from _App_Start -> (APP_PROXY_VECTORS-1)
// 378D is changed to 357D .. as per calculation 0x5FE(1534 Bytes) is allocated to Boot Sector
// Reduced Flash size to accomodate the additional interrupt vectors
FRAM : origin = 0xC403, length = 0x357D
// Added
JTAGSIGNATURE : origin = 0xFF80, length = 0x0004, fill = 0xFFFF
BSLSIGNATURE : origin = 0xFF84, length = 0x0004, fill = 0xFFFF
// Interrupt Proxy table from _App_Proxy_Vector_Start->(RESET-1)
INT00 : origin = 0xF988, length = 0x0002
INT01 : origin = 0xF98A, length = 0x0002
INT02 : origin = 0xF98C, length = 0x0002
INT03 : origin = 0xF98E, length = 0x0002
INT04 : origin = 0xF990, length = 0x0002
INT05 : origin = 0xF992, length = 0x0002
INT06 : origin = 0xF994, length = 0x0002
INT07 : origin = 0xF996, length = 0x0002
INT08 : origin = 0xF998, length = 0x0002
INT09 : origin = 0xF99A, length = 0x0002
INT10 : origin = 0xF99C, length = 0x0002
INT11 : origin = 0xF99E, length = 0x0002
INT12 : origin = 0xF9A0, length = 0x0002
INT13 : origin = 0xF9A2, length = 0x0002
INT14 : origin = 0xF9A4, length = 0x0002
INT15 : origin = 0xF9A6, length = 0x0002
INT16 : origin = 0xF9A8, length = 0x0002
INT17 : origin = 0xF9AA, length = 0x0002
INT18 : origin = 0xF9AC, length = 0x0002
INT19 : origin = 0xF9AE, length = 0x0002
INT20 : origin = 0xF9B0, length = 0x0002
INT21 : origin = 0xF9B2, length = 0x0002
INT22 : origin = 0xF9B4, length = 0x0002
INT23 : origin = 0xF9B6, length = 0x0002
INT24 : origin = 0xF9B8, length = 0x0002
INT25 : origin = 0xF9BA, length = 0x0002
INT26 : origin = 0xF9BC, length = 0x0002
INT27 : origin = 0xF9BE, length = 0x0002
INT28 : origin = 0xF9C0, length = 0x0002
INT29 : origin = 0xF9C2, length = 0x0002
INT30 : origin = 0xF9C4, length = 0x0002
INT31 : origin = 0xF9C6, length = 0x0002
INT32 : origin = 0xF9C8, length = 0x0002
INT33 : origin = 0xF9CA, length = 0x0002
INT34 : origin = 0xF9CC, length = 0x0002
INT35 : origin = 0xF9CE, length = 0x0002
INT36 : origin = 0xF9D0, length = 0x0002
INT37 : origin = 0xF9D2, length = 0x0002
INT38 : origin = 0xF9D4, length = 0x0002
INT39 : origin = 0xF9D6, length = 0x0002
INT40 : origin = 0xFBD8, length = 0x0002 // CAPTIVATE
INT41 : origin = 0xFBDA, length = 0x0002 // P2
INT42 : origin = 0xFBDC, length = 0x0002 // P1
INT43 : origin = 0xFBDE, length = 0x0002 // ADC
INT44 : origin = 0xFBE0, length = 0x0002 // USCI_B0
INT45 : origin = 0xFBE2, length = 0x0002 // USCI_A1
INT46 : origin = 0xFBE4, length = 0x0002 // USCI_A0
INT47 : origin = 0xFBE6, length = 0x0002 // WDT
INT48 : origin = 0xFBE8, length = 0x0002 // RTC
INT49 : origin = 0xFBEA, length = 0x0002 // TIMER3_A1
INT50 : origin = 0xFBEC, length = 0x0002 // TIMER3_A0
INT51 : origin = 0xFBEE, length = 0x0002 // TIMER2_A1
INT52 : origin = 0xFBF0, length = 0x0002 // TIMER2_A0
INT53 : origin = 0xFBF2, length = 0x0002 // TIMER1_A1
INT54 : origin = 0xFBF4, length = 0x0002 // TIMER1_A0
INT55 : origin = 0xFBF6, length = 0x0002 // TIMER0_A1
INT56 : origin = 0xFBF8, length = 0x0002 // TIMER0_A0
INT57 : origin = 0xFBFA, length = 0x0002 // USNMI
INT58 : origin = 0xFBFC, length = 0x0002 // SYSNMI
// App reset from _App_Reset_Vector
RESET : origin = 0xF9FE, length = 0x0002
}
/****************************************************************************/
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
/****************************************************************************/
SECTIONS
{
GROUP(ALL_FRAM)
{
GROUP(READ_WRITE_MEMORY)
{
.TI.persistent : {} /* For #pragma persistent */
}
GROUP(READ_ONLY_MEMORY)
{
.cinit : {} /* Initialization tables */
.pinit : {} /* C++ constructor tables */
.binit : {} /* Boot-time Initialization tables */
.init_array : {} /* C++ constructor tables */
.mspabi.exidx : {} /* C++ constructor tables */
.mspabi.extab : {} /* C++ constructor tables */
.const : {} /* Constant data */
}
GROUP(EXECUTABLE_MEMORY)
{
.text : {} /* Code */
}
} > FRAM
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
#ifndef __LARGE_DATA_MODEL__
.TI.ramfunc : {} load=FRAM, run=RAM, table(BINIT)
#else
.TI.ramfunc : {} load=FRAM | FRAM2, run=RAM, table(BINIT)
#endif
#endif
#endif
.jtagsignature : {} > JTAGSIGNATURE /* JTAG Signature */
.bslsignature : {} > BSLSIGNATURE /* BSL Signature */
.bss : {} > RAM /* Global & static vars */
.data : {} > RAM /* Global & static vars */
.TI.noinit : {} > RAM /* For #pragma noinit */
.cio : {} > RAM /* C I/O buffer */
.sysmem : {} > RAM /* Dynamic memory allocation area */
.stack : {} > RAM (HIGH) /* Software system stack */
.infoA : {} > INFOA /* MSP430 INFO FRAM Memory segments */
/* MSP430 INTERRUPT VECTORS */
.int00 : {} > INT00
.int01 : {} > INT01
.int02 : {} > INT02
.int03 : {} > INT03
.int04 : {} > INT04
.int05 : {} > INT05
.int06 : {} > INT06
.int07 : {} > INT07
.int08 : {} > INT08
.int09 : {} > INT09
.int10 : {} > INT10
.int11 : {} > INT11
.int12 : {} > INT12
.int13 : {} > INT13
.int14 : {} > INT14
.int15 : {} > INT15
.int16 : {} > INT16
.int17 : {} > INT17
.int18 : {} > INT18
.int19 : {} > INT19
.int20 : {} > INT20
.int21 : {} > INT21
.int22 : {} > INT22
.int23 : {} > INT23
.int24 : {} > INT24
.int25 : {} > INT25
.int26 : {} > INT26
.int27 : {} > INT27
.int28 : {} > INT28
.int29 : {} > INT29
.int30 : {} > INT30
.int31 : {} > INT31
.int32 : {} > INT32
.int33 : {} > INT33
.int34 : {} > INT34
.int35 : {} > INT35
.int36 : {} > INT36
.int37 : {} > INT37
.int38 : {} > INT38
.int39 : {} > INT39
CAPTIVATE : { * ( .int40 ) } > INT40 type = VECT_INIT
PORT2 : { * ( .int41 ) } > INT41 type = VECT_INIT
PORT1 : { * ( .int42 ) } > INT42 type = VECT_INIT
ADC : { * ( .int43 ) } > INT43 type = VECT_INIT
USCI_B0 : { * ( .int44 ) } > INT44 type = VECT_INIT
USCI_A1 : { * ( .int45 ) } > INT45 type = VECT_INIT
USCI_A0 : { * ( .int46 ) } > INT46 type = VECT_INIT
WDT : { * ( .int47 ) } > INT47 type = VECT_INIT
RTC : { * ( .int48 ) } > INT48 type = VECT_INIT
TIMER3_A1 : { * ( .int49 ) } > INT49 type = VECT_INIT
TIMER3_A0 : { * ( .int50 ) } > INT50 type = VECT_INIT
TIMER2_A1 : { * ( .int51 ) } > INT51 type = VECT_INIT
TIMER2_A0 : { * ( .int52 ) } > INT52 type = VECT_INIT
TIMER1_A1 : { * ( .int53 ) } > INT53 type = VECT_INIT
TIMER1_A0 : { * ( .int54 ) } > INT54 type = VECT_INIT
TIMER0_A1 : { * ( .int55 ) } > INT55 type = VECT_INIT
TIMER0_A0 : { * ( .int56 ) } > INT56 type = VECT_INIT
UNMI : { * ( .int57 ) } > INT57 type = VECT_INIT
SYSNMI : { * ( .int58 ) } > INT58 type = VECT_INIT
.reset : {} > RESET
/* MSP430 RESET VECTOR */
}
/****************************************************************************/
/* INCLUDE PERIPHERALS MEMORY MAP */
/****************************************************************************/
-l MSP430FR2633.cmd