This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
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?
Hi Torben
There are many solutions to handle the interrupt vector. For the solution mentioned in MSPBOOT_2_00_00_01. It use a array placed at application's code to contain the start address of the ISR as below
the 0x4030 in the original code was a BRA #dst (or MOV #dst,PC) instruction, followed by the 16 bit destination address.
You can see when the interrupt happens it will go into APP_PROXY_VECTOR(x) that is means ((uint16_t)&_Appl_Proxy_Vector_Start[x*2]) and _Appl_Proxy_Vector_Start is the array defined in application code named ProxyVectorTable.
Thanks Gary for pointing that out... In fact, I did mess up my proxy table and the CPU executed the wrong code, but I only realized when I checked against your code.
**Attention** This is a public forum