Hello,
I would like to know the goal of the RAM copy of the vector.
In my kinetis K60 example there is in the start function:
/* Copy the vector table to RAM */
if (__VECTOR_RAM != __VECTOR_TABLE)
{
for (n = 0; n < 0x410; n++)
__VECTOR_RAM[n] = __VECTOR_TABLE[n];
}
/* Point the VTOR to the new copy of the vector table */
write_vtor((uint32)__VECTOR_RAM);
What is the main advantage to copy the vector table into the RAM?
Best regard.
Hi Xavier,
Another obvious reason is if you want to dynamically change the interrupt handlers. For example, some of the Kinetis SDK code does this i.e. it installs an interrupt handler as part of the setup rather than hard coding in the vector table.
I generally prefer the VT in ROM unless there is a real need.
bye
Thank you for the answer.
you are welcome!
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
However in some application, we need move vector table to other address. A typical usage is developing boot loader code. The boot loader code occupies the first region of the FLASH memory (the lowest memory address space starting from 0x0000000).
This placement moves at the beginning of the available memory space and it is necessary to shift this address in the user application.
for more information, please see this document that may help you.
Interrupt Vector Redirection Method in Kinetis
can this answer help you?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------