cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple value for VECT_TAB_OFFSET on STM32H7

TFBorth
Associate II

Hi all, we've been developing some applications using STM32H743BG since 2020 and only now we realized that value of VECT_TAB_OFFSET has been changed according the package used in STM32Cube. So, these are the differences between different Cube versions:

STM32Cube FW_H7 V1.9.0:
#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field. This value must be a multiple of 0x200. */

STM32Cube FW_H7 V1.10.0:
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. This value must be a multiple of 0x300. */

STM32Cube FW_H7 V1.11.1:
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. This value must be a multiple of 0x400. */

So, my question is: what offset value should be used? Offset of 0x200, 0x300 or 0x400?

Where is possible to find this information on the available documentation?

Regards,

Tiago F. Borth

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The latest version is correct. It should be a multiple of 0x400. It is the lowest multiple of 2 which can contain all the vector table entries.

The restriction is part of Cortex documentation.

https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-control-block/Vector-Table-Offset-Register?lang=en

 

Note that the value of VECT_TAB_OFFSET hasn't change at all in any of these revisions. Only the comment has changed. The default value is 0 in all of them.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru

The latest version is correct. It should be a multiple of 0x400. It is the lowest multiple of 2 which can contain all the vector table entries.

The restriction is part of Cortex documentation.

https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-control-block/Vector-Table-Offset-Register?lang=en

 

Note that the value of VECT_TAB_OFFSET hasn't change at all in any of these revisions. Only the comment has changed. The default value is 0 in all of them.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hello @TFBorth 

As explained by @TDK, the vector table is defined in the "system_stm32fxxx" by default at the start address of the user Flash areaThe minimum alignment is 32 words, enough for up to 16 interrupts. For more interrupts, you can adjust the alignment by rounding up to the next power of two.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Pavel A.
Evangelist III

For several years (and many projects) on H7 I used the table alignment 0x200 and no one noticed, because all used vectors were in range of 0x200. Only noticed it when used ADC3 interrupt.

 

Can likely check the stuck-at-zero (STZ) bits of the SCB->VTOR

Although I'm not sure the alignment falls under the flash sector/page sizes in most cases.

I'd wished this define nonsense would have been dispatched years ago, as 99.9% of use cases could simply have used the linker symbols to set SCB->VTOR as built rather than create secondary dependencies.

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