Skip to content

Commit 4ac44bd

Browse files
adustm0xc0170
authored andcommitted
[STM_F0] clock the APB2ENR_SYSCFGEN in RCC so that SYSCFG->CFGR1 value can be taken into account in NVIC_SetVector
1 parent 8b10c2a commit 4ac44bd

File tree

7 files changed

+21
-0
lines changed

7 files changed

+21
-0
lines changed

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ void SystemInit(void)
226226
/* Disable all interrupts */
227227
RCC->CIR = 0x00000000;
228228

229+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
230+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
231+
229232
/* Configure the Cube driver */
230233
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
231234
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ void SystemInit(void)
227227
/* Disable all interrupts */
228228
RCC->CIR = 0x00000000;
229229

230+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
231+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
232+
230233
/* Configure the Cube driver */
231234
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
232235
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ void SystemInit(void)
227227
/* Disable all interrupts */
228228
RCC->CIR = 0x00000000;
229229

230+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
231+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
232+
230233
/* Configure the Cube driver */
231234
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
232235
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ void SystemInit(void)
227227
/* Disable all interrupts */
228228
RCC->CIR = 0x00000000;
229229

230+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
231+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
232+
230233
/* Configure the Cube driver */
231234
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
232235
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ void SystemInit(void)
227227
/* Disable all interrupts */
228228
RCC->CIR = 0x00000000;
229229

230+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
231+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
232+
230233
/* Configure the Cube driver */
231234
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
232235
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ void SystemInit(void)
226226
/* Disable all interrupts */
227227
RCC->CIR = 0x00000000;
228228

229+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
230+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
231+
229232
/* Configure the Cube driver */
230233
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
231234
HAL_Init();

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/system_stm32f0xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ void SystemInit(void)
226226
/* Disable all interrupts */
227227
RCC->CIR = 0x00000000;
228228

229+
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
230+
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
231+
229232
/* Configure the Cube driver */
230233
SystemCoreClock = 8000000; // At this stage the HSI is used as system clock
231234
HAL_Init();

0 commit comments

Comments
 (0)