cancel
Showing results for 
Search instead for 
Did you mean: 

How to set VTOR in startup script

LThal
Associate II

I'm using an ST part that has 2 banks of flash memory. I've built a code image for the second bank and downloaded it through the debugger. I've changed the startup script to set the VTOR register to the value needed for the second bank, with the line:

set *0xe000ed08 = (0x08040000)

however VTOR still has the default value for the first flash bank (0x08000000) after the download. I assume I've made a mistake in the script. Can anyone tell me how to correctly change the VTOR value in the script? Thanks.

Regards,

Lee

1 REPLY 1

Perhaps other code, in SystemInit(), which changes it.

ST has a backward macro method for setting the address, my preference is to have the linker fixup a symbol like it's designed too.

Not sure how to step the scripting here. You could probably write the value or a pattern to a RAM address as well, and check the script is executing by examining the memory in the debugger.

set *0x20002000 = (0x12345678)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..