From 375244fdc49a7dfbe592914bc28fb24312386771 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 14 Nov 2011 17:59:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3492 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/chcore_v7m.h | 8 ++++++++ os/ports/IAR/ARMCMx/chcore_v7m.h | 8 ++++++++ os/ports/RVCT/ARMCMx/chcore_v7m.h | 8 ++++++++ readme.txt | 3 +++ 4 files changed, 27 insertions(+) diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h index a2427c27e..96149cae9 100644 --- a/os/ports/GCC/ARMCMx/chcore_v7m.h +++ b/os/ports/GCC/ARMCMx/chcore_v7m.h @@ -66,6 +66,13 @@ #endif #endif +/** + * @brief NVIC VTOR initialization expression. + */ +#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__) +#define CORTEX_VTOR_INIT 0x00000000 +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -192,6 +199,7 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ + SCB_VTOR = CORTEX_VTOR_INIT; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h index ee077749c..8ebd45bda 100644 --- a/os/ports/IAR/ARMCMx/chcore_v7m.h +++ b/os/ports/IAR/ARMCMx/chcore_v7m.h @@ -66,6 +66,13 @@ #endif #endif +/** + * @brief NVIC VTOR initialization expression. + */ +#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__) +#define CORTEX_VTOR_INIT 0x00000000 +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -192,6 +199,7 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ + SCB_VTOR = CORTEX_VTOR_INIT; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ diff --git a/os/ports/RVCT/ARMCMx/chcore_v7m.h b/os/ports/RVCT/ARMCMx/chcore_v7m.h index ef04fa15e..b4181d517 100644 --- a/os/ports/RVCT/ARMCMx/chcore_v7m.h +++ b/os/ports/RVCT/ARMCMx/chcore_v7m.h @@ -66,6 +66,13 @@ #endif #endif +/** + * @brief NVIC VTOR initialization expression. + */ +#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__) +#define CORTEX_VTOR_INIT 0x00000000 +#endif + /*===========================================================================*/ /* Port derived parameters. */ /*===========================================================================*/ @@ -192,6 +199,7 @@ struct intctx { * @brief Port-related initialization code. */ #define port_init() { \ + SCB_VTOR = CORTEX_VTOR_INIT; \ SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); \ NVICSetSystemHandlerPriority(HANDLER_SVCALL, \ CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL)); \ diff --git a/readme.txt b/readme.txt index 3adb886b9..1c1bc7808 100644 --- a/readme.txt +++ b/readme.txt @@ -84,6 +84,9 @@ (backported to 2.2.8). - FIX: Fixed broken TIM8 support in STM32 PWM driver (bug 3418620). - FIX: Fixed halconf.h file corrupted in some STM32 demos (bug 3418626). +- NEW: Added initialization of the NVIC VTOR register to all Cortex-Mx (v7M) + ports. Also added a port option CORTEX_VTOR_INIT to enforce a different + default value into the register. - NEW: Removed the warning about the "untested M4 platform", now it is tested and officially supported. - NEW: Reorganized the STM32F1xx hal_lld_xxx.h files in order to distribute