STMicroelectronics / cmsis-device-g4

Provides the STM32Cube MCU Component "cmsis_device_g4" of the STM32G4 series.
Apache License 2.0
8 stars 2 forks source link

Repository forces one to fork it, if it is necessary to move the vector table #1

Open ckrenslehner opened 3 years ago

ckrenslehner commented 3 years ago

In the file "system_stm32g4xx.c" it is necessary to uncomment a line (see code below) to change the vector table offset. I included this repository as a submodule. Therefore, I am forced to fork this repo in order to uncomment the line and commit the change.

A simple #ifdef condition could solve this.

`#if defined(USER_VECT_TAB_ADDRESS) /!< Uncomment the following line if you need to relocate your vector Table in Sram else user remap will be done in Flash. / / #define VECT_TAB_SRAM /

if defined(VECT_TAB_SRAM)

define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.

                                                 This value must be a multiple of 0x200. */

define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.

                                                 This value must be a multiple of 0x200. */

else

define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.

                                                 This value must be a multiple of 0x200. */

define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.

                                                 This value must be a multiple of 0x200. */

endif / VECT_TAB_SRAM /

endif / USER_VECT_TAB_ADDRESS /`

ALABSTM commented 3 years ago

Hi @Krensi,

Thank you for having reported the point. Indeed, currently, it is not possible to redefined the VECT_TAB_OFFSET unless by manually editing the system_stm32g4xx.c file.

https://github.com/STMicroelectronics/cmsis_device_g4/blob/3a3a8909720e37bece786f6011ba865951b369c8/Source/Templates/system_stm32g4xx.c#L120

The point has been forwarded to our development teams. We will get back to you as soon as they provide their feedback.

With regards,

ALABSTM commented 3 years ago

ST Internal Reference: 116475

PennRobotics commented 3 years ago

Unless I'm misunderstanding the issue, what is the negative to using git update-index --assume-unchanged system_stm32g4xx.c to modify this locally without git reporting an out-of-sync repo while still attempting to merge future changes?