Skip to content
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

Allow VECT_TAB_OFFSET to be overridden externally (IDE or Makefile) #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pieterconradie
Copy link

It is useful to allow VECT_TAB_OFFSET to be overridden externally in the IDE or Makefile. This allows the Vector Table Offset to be at 0 for a debug build and the Vector Table Offset to be moved for a release build that has to accommodate a bootloader.

IMPORTANT INFORMATION

Contributor License Agreement (CLA)

  • The Pull Request feature will be considered by STMicroelectronics after the signature of a Contributor License Agreement (CLA) by the submitter.
  • If you did not sign such agreement, please follow the steps mentioned in the CONTRIBUTING.md file.

@RKOUSTM RKOUSTM self-assigned this Sep 17, 2020
@RKOUSTM RKOUSTM added bug Something isn't working spotted before customer Spotted and fixed internally before being pointed out by users but not published yet labels Sep 17, 2020
@RKOUSTM
Copy link
Contributor

RKOUSTM commented Sep 17, 2020

Hi @pieterconradie,

Thank you for your suggestion and contribution. A fix for this code below:

/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00U /*!< Vector Table base offset field.
This value must be a multiple of 0x100. */
/******************************************************************************/

will be published as soon in in future release (STM32L0Cube V1.12.0) looks like the following:

+ #if defined(USER_VECT_TAB_ADDRESS)
/* #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 */

Thank you again for your contribution.

With regards,

@RKOUSTM RKOUSTM moved this from To do to To release in stm32cube-mcu-fw-dashboard Sep 17, 2020
@pieterconradie
Copy link
Author

@RKOUSTM Thanks for attending to the pull request so quickly :)

I am probably missing something but I can not see from the solution above how VECT_TAB_OFFSET can be overridden(?). In both cases above it is #defined as 0x00000000U

Should it not be:

#ifndef VECT_TAB_OFFSET
#define VECT_TAB_OFFSET 0x00000000U
#endif

Thanks in advance,
Pieter

@RKOUSTM
Copy link
Contributor

RKOUSTM commented Sep 17, 2020

Hi @pieterconradie,

Thank you for your contribution. The vector table is updated by a generic preprocessor directive USER_VECT_TAB_ADDRESS to mention if we are on FLASH or SRAM, and if we want to apply an offset. Offset being a multiple of fixed value depending on Arm processor architecture. The vector table will be kept at address 0x00 which correspond to automatic remap of boot address selected. On any STM32 target, vector table is set to 0x00u which is always the right default address as

  1. there is always a memory remap between boot address and @0x00
  2. for dual core, CPU2 is booting on boot @ + SBRV register offset.

Thank you again for your contribution.

With regards,

@RKOUSTM RKOUSTM added this to the v1.12.0 milestone Sep 21, 2020
@ALABSTM ALABSTM added the cmsis CMSIS-related issue or pull-request. label Sep 28, 2020
@fpistm
Copy link

fpistm commented Oct 9, 2020

I've the same concern than @pieterconradie
STMicroelectronics/STM32CubeF4#30 (comment)

@RKOUSTM
Copy link
Contributor

RKOUSTM commented Mar 3, 2021

Hi @pieterconradie,

I hope you are fine. The issue you reported has been fixed in the frame of version v1.12.0 of the STM32CubeL0 published on GitHub.

Thank you again for having reported.

With regards,

@RKOUSTM RKOUSTM closed this Mar 3, 2021
stm32cube-mcu-fw-dashboard automation moved this from To release to Done Mar 3, 2021
@ALABSTM
Copy link
Contributor

ALABSTM commented Oct 25, 2021

See also STM32CubeF4#30.

@ALABSTM
Copy link
Contributor

ALABSTM commented Oct 25, 2021

See also STM32CubeF4#64.

@ALABSTM ALABSTM added enhancement New feature or request internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system duplicate This issue or pull request already exists and removed bug Something isn't working spotted before customer Spotted and fixed internally before being pointed out by users but not published yet labels Oct 25, 2021
@ALABSTM
Copy link
Contributor

ALABSTM commented Oct 25, 2021

ST Internal Reference: 116475

@ALABSTM ALABSTM reopened this Oct 25, 2021
stm32cube-mcu-fw-dashboard automation moved this from Done to To do Oct 25, 2021
@ALABSTM
Copy link
Contributor

ALABSTM commented Oct 25, 2021

Hi @pieterconradie,

I hope you are fine. We reopened the point as the current implementation does not address the requirement to be able to redefine VECT_TAB_OFFSET without the need to manually edit the system_stm32l0xx.c file.

We will get back to you as soon as we get feedback from our development teams.

With regards,

@RJMSTM RJMSTM closed this Mar 7, 2023
stm32cube-mcu-fw-dashboard automation moved this from In progress to Done Mar 7, 2023
@ALABSTM ALABSTM removed the duplicate This issue or pull request already exists label Dec 22, 2023
@STMicroelectronics STMicroelectronics deleted a comment from RKOUSTM Dec 22, 2023
@ALABSTM ALABSTM removed this from the v1.12.0 milestone Dec 22, 2023
@ALABSTM ALABSTM reopened this Dec 22, 2023
stm32cube-mcu-fw-dashboard automation moved this from Done to To do Dec 22, 2023
@ALABSTM ALABSTM moved this from To do to In progress in stm32cube-mcu-fw-dashboard Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmsis CMSIS-related issue or pull-request. enhancement New feature or request internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants