Skip to content

Commit cdf7a03

Browse files
committed
NVIC - first time set old vectors to flash vector address
1 parent db51af8 commit cdf7a03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/cmsis_nvic.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
4343
uint32_t i;
4444

4545
/* Copy and switch to dynamic vectors if the first time called */
46-
if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) {
47-
uint32_t *old_vectors = vectors;
46+
if (SCB->VTOR != NVIC_RAM_VECTOR_ADDRESS) {
47+
uint32_t *old_vectors = (uint32_t *) NVIC_FLASH_VECTOR_ADDRESS;
4848
vectors = (uint32_t *) NVIC_RAM_VECTOR_ADDRESS;
4949
for (i = 0; i < NVIC_NUM_VECTORS; i++) {
5050
vectors[i] = old_vectors[i];

0 commit comments

Comments
 (0)