From 44b0aa9b73aa508ece4d04278a75a7587f62ee15 Mon Sep 17 00:00:00 2001 From: Lieven Hollevoet Date: Mon, 5 May 2014 14:39:01 +0200 Subject: [PATCH] Ensure the NVIC table gets copied to RAM even when it is not located at 0x00. This is useful in case you're using a secondary bootloader to load application code that is using the mbed libraries on a bare metal controller. --- .../mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.c b/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.c index 9e08052795..f47d5de754 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.c +++ b/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/cmsis_nvic.c @@ -13,7 +13,7 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { uint32_t i; // Copy and switch to dynamic vectors if the first time called - if (SCB->VTOR == NVIC_FLASH_VECTOR_ADDRESS) { + if (SCB->VTOR < NVIC_RAM_VECTOR_ADDRESS) { uint32_t *old_vectors = vectors; vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; for (i=0; i