I am using ksdk 1.3, MQX with no PE. uP is MK22FX512A.
The init_data_bss function in startup.c, does indeed copy the vectors at ROM location 0 to RAM location 0x1FFF0000 and sets VTOR to 0x1FFF0000.
The _bsp_pre_init() function has the code:
//****************************************************************************************************
result = _psp_int_init(BSP_FIRST_INTERRUPT_VECTOR_USED, BSP_LAST_INTERRUPT_VECTOR_USED);
if (result != MQX_OK) return result;
/******************************************************************************
Init MQX tick timer
******************************************************************************/
/* Initialize , set and run system hwtimer */
result = HWTIMER_SYS_Init(&systimer, &BSP_SYSTIMER_DEV, BSP_SYSTIMER_ID, NULL);
if (kStatus_OSA_Success != result) return MQX_INVALID_POINTER;
| /* Set isr for timer*/ |
| if (NULL == OSA_InstallIntHandler(BSP_SYSTIMER_INTERRUPT_VECTOR, HWTIMER_SYS_SystickIsrAction)) |
| { |
| | return kHwtimerRegisterHandlerError; |
| } |
//***************************************************************************************************
_psp_int_init() calls _int_init() in psp_iinit.c which calls _int_init() in int.c. _int_init() allocates a block of memory (at 0x1fff4f1c in my case) for an interrupt table, initializes the table with internal default ISR vectors.
OSA_InstallIntHandler() calls _int_install_isr(), which puts the vector into the table allocated by _int_init().
However, at the end of all this, VTOR still points to 0x1FFF0000, and none of the vectors in that table have been changed from the original copies from ROM location 0. So when I get the first MQX systick interrupt, it goes to the original default ISR specified in the oriiginal ROM table and hangs.
I would think that MQX code would use and modify the RAM vector table already pointed to by VTOR. It certainly can't set VTOR to 0x1fff4f1c because it isn't aligned properly. What am I missing?