I've updated my linker file, so that the IVT should be located at 0x2300.
MEMORY
{
m_flash_config (RX) : ORIGIN = 0x000022F0, LENGTH = 0x00000010
m_interrupts (RX) : ORIGIN = 0x00002300, LENGTH = 0x00000100
m_foo_data (RW) : ORIGIN = 0x00002400, LENGTH = 0x00000400
m_bar_data (RW) : ORIGIN = 0x00002800, LENGTH = 0x00000400
m_baz_data (RW) : ORIGIN = 0x00002C00, LENGTH = 0x00000400
m_qux_data (RW) : ORIGIN = 0x00003000, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x00003400, LENGTH = 0x0003CC00
m_data (RW) : ORIGIN = 0x1FFFE000, LENGTH = 0x00008000
}
Upon launching the debugger I can see the IVT at 0x2300, as well as the implemented ISR vectors at their respective offsets, in the memory view. My SCB->VTOR value is also set to the expected 0x2300. The only other thing I see, which I can't explain, is that when I inspect __VECTOR_TABLE it's value is still 0x20006000. I'm not sure if that's an issue or not. I have only these four ISRs implemented:
Does anyone know what's wrong here?
Hi, Jim,
Can you tell me the tools and part number you are using?
I have checked the project which is created with KDS tools, this is the definition of __VECTOR_TABLE
If you locate the interrupt table in internal SRAM, in other words, "m_interrupts" is defined as SRAM address, of course, the __VECTOR_TABLE is also in SRAM, in other words, The __VECTOR_TABLE has the same value as "m_interrupts".
Hope it can help you
BR
XiangJun rong
/* Define output sections */
SECTIONS
{
/* The startup code goes first into internal flash */
.interrupts :
{
__VECTOR_TABLE = .;
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} > m_interrupts
Thanks for the quick reply. I'm using the MKL17Z256VLH4 and Kinetis Design Studio v3.2.0. I thought that my IVT was located in flash. Does it need to be stored in RAM? Perhaps that is the piece I am missing. If so, how does the IVT normally get copied to RAM?
Oddly, in the map file, I can see that both m_interrupts and __VECTOR_TABLE are at address 0x2300. When I look at address 0x2300 in the Memory window I can see my interrupt vectors. However, vector 0 is address 0x20006000, which is the value of __VECTOR_TABLE when viewed in the Expressions window. Interestingly, when the debugger initially launches SCB->VTOR is 0x2300, but when program execution stops due to the invalid ISV the value of SCB->VTOR is 0.