Skip to content

Please add Vector table relocation option for STM32H7xx #2054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wystewart opened this issue Jul 8, 2023 · 1 comment · Fixed by #2061
Closed

Please add Vector table relocation option for STM32H7xx #2054

wystewart opened this issue Jul 8, 2023 · 1 comment · Fixed by #2061
Labels
enhancement New feature or request
Milestone

Comments

@wystewart
Copy link

wystewart commented Jul 8, 2023

Please add the option to relocate the vector table from build_opt.h for STM32H7xx

The STM32F7xx has that feature with #ifndef VECT_TAB_BASE_ADDRESS in /system/STM32F7xx/system_stm32f7xx.c

Please add this to system/STM32H7xx/system_stm32h7xx.c as well per below. The only thing to be added is the #ifndef VECT_TAB_BASE_ADDRESS around the block of code shown below extracted from system_stm32h7xx.c.

This allows me to specify the vector table address in built_opt.h in the sketch (such as -DVECT_TAB_BASE_ADDRESS=0x90000000). I have a separate boot loader so that I can boot from QSPI. (For those that what to try this, note that the Arduino IDE can't program the QSPI, at least not without modification of the programming script, so I just use the STM32CubeProgrammer. it is quite handy that once I point it to the sketch bin file, it remembers the location the next time I start the tool).

#ifndef VECT_TAB_BASE_ADDRESS
#if defined(DUAL_CORE) && defined(CORE_CM4)
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS   D2_AXISRAM_BASE   /*!< Vector Table base address field.
                                                       This value must be a multiple of 0x300. */
#else
#define VECT_TAB_BASE_ADDRESS   FLASH_BANK2_BASE  /*!< Vector Table base address field.
                                                       This value must be a multiple of 0x300. */
#endif /* VECT_TAB_SRAM */

#else
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS   D1_AXISRAM_BASE   /*!< Vector Table base address field.
                                                       This value must be a multiple of 0x300. */
#else
#define VECT_TAB_BASE_ADDRESS   FLASH_BANK1_BASE  /*!< Vector Table base address field.
                                                       This value must be a multiple of 0x300. */
#endif /* VECT_TAB_SRAM */
#endif /* DUAL_CORE && CORE_CM4 */
#endif

fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Jul 10, 2023
Fixes stm32duino#2054

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistm
Copy link
Member

fpistm commented Jul 10, 2023

Hi @wystewart
I've added the possibility to redefine the VECT_TAB_BASE_ADDRESS for H7 ans also for WL.

@fpistm fpistm added this to the 2.7.0 milestone Jul 10, 2023
@fpistm fpistm added the enhancement New feature or request label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants