cancel
Showing results for 
Search instead for 
Did you mean: 

Replacement for NVIC_SetVectorTable ?

Posted on June 16, 2015 at 01:35

In the latest HAL on the F1 (and F4) (http://www.st.com/st-web-ui/static/active/cn/resource/technical/document/user_manual/DM00154pdf )
 Doesnt seem to contain 
 NVIC_SetVectorTable(NVIC_VectTab_FLASH, USER_PROG_OFFSET);
 Hence there is no HAL way to change the Vector table start address (to account for the use of a bootloader etc)
 Is the preferred method to change 
 SCB->VTOR
 in main ?

2 REPLIES 2
Posted on June 16, 2015 at 02:06

In the CMSIS/SPL mechanics the vector table, and clocks, are generally set via a call into SystemInit(), which is called prior to the initialization of the statics, and a call to main()

I generally prefer SCB->VTOR, primarily because it's unambiguous, none of the base+offset stuff, just pointing directly at the table.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 16, 2015 at 02:31

I can see that SCB->VTOR is initially setup in SystemInit()

However I was looking for a solution where I did not need to change any of the ''Template'' files from the output of CubeMX

i.e I want to ''generate'' separate HAL code folders for different processors (F1 and F4), and be able to select at compile time, which HAL to use

I also wanted to be able to update the HAL folders if there is an update to CubeMX

However, I think you are saying that I need to change the ''template'' files generated by CubeMX to achieve what I want.

This is OK, because I guess the CubeMX does not change very often.

I just want to make sure I do things correctly.