Tool/software:
Dear Texas Instruments Support Team,
I am currently implementing a bootloader for the MSP430F67691A and have encountered an issue where interrupts are not functioning correctly after jumping from the bootloader to the application.
Issue Details:
- The bootloader successfully loads and jumps to the application.
- After the jump, the application runs, but interrupts do not seem to trigger as expected.
- The application vector table is correctly placed at 0xFF80 - 0xFFFF, and the reset vector at 0xFFFE points to the application entry point.
- I have disabled global interrupts before the jump and re-enabled them in the application, but the issue persists.
I use proxy vector table in application also interrupts are not generated ,so I attached my both application and boot cmd file can you check the memory allocation is correct or not.
Does the bootloader need to explicitly reconfigure the vector table after jumping to the application?
/*application code cmd file*/
/* ============================================================================ */
/* Copyright (c) 2020, Texas Instruments Incorporated */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* * Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* * Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* * Neither the name of Texas Instruments Incorporated nor the names of */
/* its contributors may be used to endorse or promote products derived */
/* from this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* ============================================================================ */
/******************************************************************************/
/* lnk_msp430f67691a.cmd - LINKER COMMAND FILE FOR LINKING MSP430F67691A PROGRAMS */
/* */
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */
/* */
/*----------------------------------------------------------------------------*/
/* These linker options are for command line linking only. For IDE linking, */
/* you should set your linker options in Project Properties */
/* -c LINK USING C CONVENTIONS */
/* -stack 0x0100 SOFTWARE STACK SIZE */
/* -heap 0x0100 HEAP AREA SIZE */
/* */
/*----------------------------------------------------------------------------*/
/* Version: 1.213 */
/*----------------------------------------------------------------------------*/
/****************************************************************************/
/* Specify the system memory map */
/****************************************************************************/
/* RAM Memory Addresses */
__RAM_Start = 0x1C00; /* RAM Start */
__RAM_End = 0x9BFF; /* RAM End */
/* RAM shared between App and Bootloader, must be reserved */
PassWd = 0x1C00; /* Password sent by App to force boot mode */
StatCtrl = 0x1C02; /* Status and Control byte used by Comm */
CI_State_Machine = 0x1C03; /* State machine variable used by Comm */
CI_Callback_ptr = 0x1C04; /* Pointer to Comm callback structure */
/* Unreserved RAM used for Bootloader or App purposes */
_NonReserved_RAM_Start = 0x1C08; /* Non-reserved RAM */
/* Flash memory addresses */
_Appl_Start = 0xC000; /* Start of Application area */
_Appl_End = 0xF3FF; /* End of Application area */
_Flex_Start = 0x10000; /* Start of flex space (app or download, project-dependent) */
_Flex_End = 0x8BFFF; /* End of flex space (app or download, project-dependent) */
/* Flash memory addresses */
__Flash_Start = 0xC000; /* Start of Application area */
/* Reserved Flash locations for Bootloader Area */
__Boot_Start = 0xF400; /* Boot flash */
__Boot_Reset = 0xFFFE; /* Boot reset vector */
__Boot_VectorTable = 0xFF80; /* Boot vector table */
__Boot_SharedCallbacks_Len = 6; /* Length of shared callbacks (2 calls =4B(msp430) or 8B(msp430x) */
__Boot_SharedCallbacks = 0xFF7A; /* Start of Shared callbacks */
_Appl_Proxy_Vector_Start = 0xF302; /* Proxy interrupt table */
_Appl_Reset_Vector = (__Boot_Start - 2);
/* 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 : origin = 0x1C00, length = 0x8000
INFOA : origin = 0x1980, length = 0x0080
INFOB : origin = 0x1900, length = 0x0080
INFOC : origin = 0x1880, length = 0x0080
INFOD : origin = 0x1800, length = 0x0080
FLASH : origin = 0xC002,length = 0x3300
FLASH2 : origin = 0x10000,length = 0x7BFFF /* Boundaries changed to fix CPU47 */
// Interrupt Proxy table from _App_Proxy_Vector_Start->(RESET-1)
APP_PROXY_VECTORS : origin = 0xF302, length = 0xFC
// App reset from _App_Reset_Vector
RESET : origin = 0xF3FE, length = 0x0002
}
/****************************************************************************/
/* Specify the sections allocation into memory */
/****************************************************************************/
SECTIONS
{
.bss : {} > RAM /* Global & static vars */
.data : {} > RAM /* Global & static vars */
/* .TI.noinit : {} > RAM For #pragma noinit */
.sysmem : {} > RAM /* Dynamic memory allocation area */
.stack : {} > RAM (HIGH) /* Software system stack */
.text:_isr : {} > FLASH /* Code ISRs */
#ifndef __LARGE_CODE_MODEL__
.text : {} >> FLASH /* CODE */
#else
.text : {} >> FLASH | FLASH2 /* CODE */
#endif
.cinit : {} > FLASH2 /* INITIALIZATION TABLES*/
#ifndef __LARGE_DATA_MODEL__
.const : {} >> FLASH /* CONSTANT DATA */
#else
.const : {} >> FLASH2 | FLASH /* CONSTANT DATA */
#endif
.cio : {} > RAM /* C I/O Buffer */
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
#ifndef __LARGE_CODE_MODEL__
.TI.ramfunc : {} load=FLASH, run=RAM, table(BINIT)
#else
.TI.ramfunc : {} load=FLASH | FLASH2, run=RAM, table(BINIT)
#endif
#endif
#endif
.infoA : {} > INFOA /* MSP430 INFO FLASH Memory segments */
.infoB : {} > INFOB
.infoC : {} > INFOC
.infoD : {} > INFOD
.APP_PROXY_VECTORS : {} > APP_PROXY_VECTORS /* INTERRUPT PROXY TABLE */
.reset : {} > RESET /* MSP430 Reset vector */
}
/****************************************************************************/
/* Include peripherals memory map */
/****************************************************************************/
-l msp430f67691a.cmd
/*bootcode cmd file*/
/******************************************************************************/
/* LINKER COMMAND FILE FOR MSPBoot BOOTLOADER USING msp430f67691A */
/* File generated with MSPBoot_linkergen_Flash.pl on 24-02-2025 */
/*----------------------------------------------------------------------------*/
/****************************************************************************/
/* SPECIFY THE SYSTEM MEMORY MAP */
/****************************************************************************/
/* The following definitions can be changed to customize the memory map for a different device
* or other adjustments
* Note that the changes should match the definitions used in MEMORY and SECTIONS
*
*/
/* RAM Memory Addresses */
__RAM_Start = 0x1C00; /* RAM Start */
__RAM_End = 0x9BFF; /* RAM End */
/* RAM shared between App and Bootloader, must be reserved */
PassWd = 0x1C00; /* Password sent by App to force boot mode */
StatCtrl = 0x1C02; /* Status and Control byte used by Comm */
CI_State_Machine = 0x1C03; /* State machine variable used by Comm */
CI_Callback_ptr = 0x1C04; /* Pointer to Comm callback structure */
/* Unreserved RAM used for Bootloader or App purposes */
_NonReserved_RAM_Start = 0x1C08; /* Non-reserved RAM */
/* Flash memory addresses */
_Appl_Start = 0xC000; /* Start of Application area */
_Appl_End = 0xF3FF; /* End of Application area */
_Flex_Start = 0x10000; /* Start of flex space (app or download, project-dependent) */
_Flex_End = 0x8BFFF; /* End of flex space (app or download, project-dependent) */
/* Reserved Flash locations for Bootloader Area */
__Boot_Start = 0xF400; /* Boot flash */
__Boot_Reset = 0xFFFE; /* Boot reset vector */
__Boot_VectorTable = 0xFF80; /* Boot vector table */
__Boot_SharedCallbacks_Len = 6; /* Length of shared callbacks (2 calls =4B(msp430) or 8B(msp430x) */
__Boot_SharedCallbacks = 0xFF7A; /* Start of Shared callbacks */
_Appl_Proxy_Vector_Start = 0xF302; /* Proxy interrupt table */
/* Reserved Flash locations for Application Area */
_Appl_Checksum = (_Appl_Start); /* CRC16 of Application */
_Appl_Start_Memory = (_Appl_Start+2); /* Application Area */
_Appl_CRC_Size1 = (_Appl_End - _Appl_Start_Memory +1); /* Number of bytes in lower memory calculated for CRC */
_Appl_CRC_Size2 = (_Flex_End - _Flex_Start + 1); /* Number of bytes in upper memory calculated for CRC */
_Appl_Reset_Vector = (__Boot_Start - 2);
/* 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
RAM : origin = 0x1C08, length = 0x7FF7
// Flash from __Boot_Start -( __Boot_SharedCallbacks or INT_VECTOR_TABLE)
FLASH : origin = 0xF400, length = 0xB7A
// Shared callbacks from __Boot_SharedCallbacks + Len (when used)
BOOT_SHARED_CALLBACKS : origin = 0xFF7A, length = 6
// Boot vector Table from __Boot_VectorTable- __Boot_Reset
INT_VECTOR_TABLE : origin = 0xFF80, length = 0x7E
// 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 /* CODE */
.cinit : {} > FLASH /* INITIALIZATION TABLES*/
.const : {} >> FLASH /* 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 msp430f67691a.cmd
Any guidance on best practices for handling interrupts during the bootloader-to-application transition would be greatly appreciated.
Thank you for your time and support.
Ankush