Other Parts Discussed in Thread: MSP430F5529
Hi,
I am currently working on a custom main memory bootloader based on MSPBOOT_2_00_00_01. I modified the example code for the MSP430F5529, and the bootloader itself works fine. But it seems that the interrupt vector table is not written correctly. As far as I have understood, the interrupt vector table (0xFFE0 - 0xFFFF in the case of the AFE253) should be filled with proxy vectors which point to locations in application memory where in turn the application's "interrupt vectors" reside. I have also modified the linker file (using IAR) for the bootloader's vectors:
-Z(CODE)INTVEC=_FLASH_VECTORS_START-_FLASH_END -Z(CONST)BOOT_VECTOR_TABLE=_FLASH_VECTORS_START-_FLASH_END -Z(CODE)RESET=_FLASH_RESET_VECTOR-_FLASH_END
with _FLASH_VECTORS_START = 0xFFE0. In the bootloader code there is a file called TI_MSPBoot_VecRed_Boot.c:
/******************************************************************************/
/* Vector Redirection FILE FOR MSPBoot BOOTLOADER USING MSP430F5529 */
/* File generated with MSPBootVecRedGen.pl on 08-01-2017 */
/*----------------------------------------------------------------------------*/
//
// Include files
//
#include <stdint.h>
#include "msp430afe253.h"
#include "TI_MSPBoot_Common.h"
#include "TI_MSPBoot_AppMgr.h"
//
// External variables from linker file
//
extern uint16_t _App_Proxy_Vector_Start[]; /* Proxy table address */
//
// Macros and definitions
//
/* Value written to unused vectors */
#define UNUSED (0xBFFF)
/*! Macro used to calculate address of vector in Application Proxy Table */
#define APP_PROXY_VECTOR(x) ((uint16_t)&_App_Proxy_Vector_Start[x*2])
//
// Constant table
//
/*! MSPBoot Vector Table: It's fixed since it can't be erased and modified.
* Points to a proxy vector table in Application area*/
#pragma location="BOOT_VECTOR_TABLE"
const uint16_t Vector_Table[] =
{
0x1234, //APP_PROXY_VECTOR(0), // FFE0 = unknown
APP_PROXY_VECTOR(1), // FFE2 = Port 2
APP_PROXY_VECTOR(2), // FFE4 = unknown
APP_PROXY_VECTOR(3), // FFE6 = unknown
APP_PROXY_VECTOR(4), // FFE8 = Port 1
APP_PROXY_VECTOR(5), // FFEA = Timer0_A1, Timer0_A2
APP_PROXY_VECTOR(6), // FFEC = Timer0_A0
APP_PROXY_VECTOR(7), // FFEE = unknown
APP_PROXY_VECTOR(8), // FFF0 = USART0 Transmit
APP_PROXY_VECTOR(9), // FFF2 = USART0 Receive
APP_PROXY_VECTOR(10), // FFF4 = Watchdog
APP_PROXY_VECTOR(11), // FFF6 = unknown
APP_PROXY_VECTOR(12), // FFF8 = SD24_A
APP_PROXY_VECTOR(13), // FFFA = unknown
APP_PROXY_VECTOR(14), // FFFC = NMI
};
So, when I debug the bootloader, I expect my device to have a variable Vector_Table placed at BOOT_VECTOR_TABLE (which shold be 0xFFE0) and start with a value of 0x1234. But it seems the table is not placed at all or in the wrong place, because when looking at the memory at 0xFFE0, there's just 0xFFFF until the reset vector finally is placed. Can you give me some hints?