Skip to content

Commit 455d6c6

Browse files
committed
system(wb0): update STM32WB0x system
Remove duplicate clock definition. Allow VECT_TAB_OFFSET redefinition. Signed-off-by: Frederic Pillon <[email protected]>
1 parent b1a7ffd commit 455d6c6

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

system/STM32WB0x/system_stm32wb0x.c

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,28 @@
7575
/** @addtogroup STM32WB0x_System_Private_Defines
7676
* @{
7777
*/
78-
#if !defined (HSE_VALUE)
79-
#define HSE_VALUE (32000000U) /*!< Value of the External oscillator in Hz */
80-
#endif /* HSE_VALUE */
81-
82-
#if !defined (HSI_VALUE)
83-
#define HSI_VALUE (64000000U) /*!< Value of the Internal oscillator in Hz*/
84-
#endif /* HSI_VALUE */
8578

8679
/* Note: Following vector table addresses must be defined in line with linker
8780
configuration. */
88-
/*!< Uncomment the following line if you need to relocate the vector table
89-
anywhere in Flash or Sram, else the vector table is kept at the automatic
90-
remap of boot address selected */
91-
/* #define USER_VECT_TAB_ADDRESS */
81+
#if !defined(VECT_TAB_OFFSET)
82+
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
83+
This value must be a multiple of 0x100. */
84+
#endif /* VECT_TAB_OFFSET */
9285

93-
#if defined(USER_VECT_TAB_ADDRESS)
9486
/*!< Uncomment the following line if you need to relocate your vector Table
9587
in SRAM else user remap will be done in FLASH. */
9688
/* #define VECT_TAB_SRAM */
89+
90+
#if !defined(VECT_TAB_BASE_ADDRESS)
9791
#if defined(VECT_TAB_SRAM)
9892
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
9993
This value must be a multiple of 0x100. */
100-
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
101-
This value must be a multiple of 0x100. */
94+
10295
#else
10396
#define VECT_TAB_BASE_ADDRESS NVM_BASE /*!< Vector Table base address field.
10497
This value must be a multiple of 0x100. */
105-
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
106-
This value must be a multiple of 0x100. */
10798
#endif /* VECT_TAB_SRAM */
108-
#endif /* USER_VECT_TAB_ADDRESS */
99+
#endif /* VECT_TAB_BASE_ADDRESS */
109100

110101
/******************************************************************************/
111102

@@ -211,11 +202,7 @@ void SystemInit(void)
211202
}
212203

213204
/* Configure the Vector Table location */
214-
#if defined(USER_VECT_TAB_ADDRESS)
215205
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation */
216-
#else
217-
SCB->VTOR = (uint32_t) (__vector_table);
218-
#endif /* USER_VECT_TAB_ADDRESS */
219206

220207
/* Store in RAM the AppBase information */
221208
RAM_VR.AppBase = (uint32_t) SCB->VTOR;

0 commit comments

Comments
 (0)