Skip to main content
LThal
Associate III
January 17, 2019
Question

How to set VTOR in startup script

  • January 17, 2019
  • 1 reply
  • 779 views

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

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
January 17, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..