How to relocate vector table and change starting addressin cortexm3 using uvision(Keil)?

suraj picture suraj · Feb 7, 2013 · Viewed 21.2k times · Source

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?

Answer

Grissiom picture Grissiom · Aug 1, 2013

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.