Closed theadib closed 3 years ago
Hi @theadib,
I hope you are fine. Our development teams said your proposal could not be taken into consideration for the following reason:
The modifying of VTOR is now only performed if USER_VECT_TAB_ADDRESS is activated (in the IDE or directly in the file). This is done on purpose as the memory remap is performed at boot, allows the vector table to be basically at address 0x00. So, if the user does not want to relocate it anywhere else, there is no need to access this register. More than that some products (like dual CPU ones) use the boot address from the option bytes, so having a generic way of setting VTOR is worse than letting the default configuration (option bytes set boot @ => that one is remapped @ 0x0)
Please allow me to close this issue now and thank you for your comprehension. We are looking forward to reading from you again.
With regards,
Hi @theadib,
Hope you are fine. Back to you about the points you raised:
- please set the vector address register regardless of USER_VECT_TAB_ADDRESS
- please test before setting VECT_TAB_OFFSET
- however I do not really understand the use of USER_VECT_TAB_ADDRESS
Regarding point 1, as explained by @RKOUSTM, the default value 0x00000000 of the SCB->VOTR
register after a re-boot supposes the vector table is located at address 0x08000000, which is the default setting. Since address 0x08000000 is aliased 0x00000000 by default, access to the vector table will be correctly performed in case of interrupt.
This is why, in case this default setting is not to be changed by the user, there is no need to write-access the SCB->VTOR
register during system initialization. Now, this also supposes, in case of a custom board, that pin BOOT0
is connected to the GND
. You can find more details in the reference manual.
Regarding points 2 and 3, we do agree that, even with the new proposal, it is not yet possible to define the VECT_TAB_OFFSET
at IDE- or Makefile-level. The point has been reported to our development teams. You can follow the progress here.
With regards,
Same problem with IAP. Forced to make this modification with each code regeneration, it is rather painful. Strongly that this is put in place !!
Hello ST Team not solved at all at the 1.27.1 release.
here a pullrequest to SOLVE the issue. https://github.com/STMicroelectronics/STM32CubeF4/pull/146
Adib.
@see https://github.com/STMicroelectronics/STM32CubeF4/issues/30 @see https://github.com/STMicroelectronics/STM32CubeF4/pull/64
Hello ST Team please listen to your users.
I need to be able to redefine the position of the vector table based on compiler defines. So that I do not need to modify code when I compile for target that has bootloader. in my proposal #30 this was possible.
now in 1.26 the template code lookes like that: https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
and
1) please set the vector address register regardless of USER_VECT_TAB_ADDRESS
2) please test before setting VECT_TAB_OFFSET
3) however I do not really understand the use of USER_VECT_TAB_ADDRESS this define should hold the address itself. why is it not as simple as: