I'm using a STM32F107 cortex m3 microcontroller. I'm using the Keil uvision IDE for the project. I have an application which is running properly at the starting location i.e 0x0800 0000
. If I change the starting location to 0x0800 4000
the application is not working properly. I made changes to the vector table location using this function as such:
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x8004000)
i.e changed SCB->VTOR = 0x8004000
to this location.
But even after doing this interrupt is not happening. Should I do anything more to make this project work?
This is a three-step process that involves: Setting the starting address of your program (in the startup file), Setting the offset for interrupt vectors (using a compiler directive), and Setting the address range for program code (using a linker directive).
Vector Table Offset Register. The VTOR indicates the offset of the vector table base address from memory address 0x00000000 . See System control block registers summary for the VTOR attributes. In an implementation with the Security Extension, this register is not banked between Security states.
Exception numbers 1 to 15 are classified as system exceptions, and exceptions 16 and above are for interrupts. The design of the NVIC in the Cortex-M3 and Cortex-M4 processors can support up to 240 interrupt inputs.
You should not use NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x8004000)
, use NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x4000)
. The second argument is the "offset", not the absolute address.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With