Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Sorry for reply late.
1) Please refer to the below code to copy the vector table to RAM from flash.
void BOARD_RelocateVectorTableToRam(void)
{
uint32_t n;
uint32_t irqMaskValue;
irqMaskValue = DisableGlobalIRQ();
SCB_DisableDCache();
SCB_DisableICache();
/* Copy the vector table from ROM to RAM */
for (n = 0; n < ((uint32_t)0x400) / sizeof(uint32_t); n++)
{
g_vectorTable[n] = __VECTOR_TABLE[n];
}
/* Set application defined stack pointer */
volatile unsigned int vStackTop = (unsigned int)&__StackTop;
g_vectorTable[0] = vStackTop;
/* Point the VTOR to the position of vector table */
SCB->VTOR = (uint32_t)g_vectorTable;
__DSB();
SCB_EnableICache();
SCB_EnableDCache();
EnableGlobalIRQ(irqMaskValue);
}
2) Actually, I don't think the performance will boost obviously just by relocating the vector table.
So please refer to the application note to learn how to optimize the system performance running on the different memory devices.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------