From 9f95ff5b6ba01db09552b84a0ab79607060a2666 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Wed, 11 Dec 2019 08:59:21 +0100 Subject: Official ARM version: v5.4.0 Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3 --- docs/Core/html/using_VTOR_pg.html | 181 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 docs/Core/html/using_VTOR_pg.html (limited to 'docs/Core/html/using_VTOR_pg.html') diff --git a/docs/Core/html/using_VTOR_pg.html b/docs/Core/html/using_VTOR_pg.html new file mode 100644 index 0000000..38958cc --- /dev/null +++ b/docs/Core/html/using_VTOR_pg.html @@ -0,0 +1,181 @@ + + + + + +Using Interrupt Vector Remap +CMSIS-Core (Cortex-M): Using Interrupt Vector Remap + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-Core (Cortex-M) +  Version 5.1.2 +
+
CMSIS-Core support for Cortex-M processor-based devices
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Using Interrupt Vector Remap
+
+
+

Most Cortex-M processors provide VTOR register for remapping interrupt vectors. The following example shows a typical use case where the interrupt vectors are copied to RAM and the SysTick_Handler is replaced.

+
#include "ARMCM3.h" // Device header
+
+
/* externals from startup_ARMCM3.s */
+
extern uint32_t __Vectors[]; /* vector table ROM */
+
+
#define VECTORTABLE_SIZE (256) /* size Cortex-M3 vector table */
+
#define VECTORTABLE_ALIGNMENT (0x100ul) /* 16 Cortex + 32 ARMCM3 = 48 words */
+
/* next power of 2 = 256 */
+
+
/* new vector table in RAM */
+
uint32_t vectorTable_RAM[VECTORTABLE_SIZE] __attribute__(( aligned (VECTORTABLE_ALIGNMENT) ));
+
+
/*----------------------------------------------------------------------------
+
SysTick_Handler
+
*----------------------------------------------------------------------------*/
+
volatile uint32_t msTicks = 0; /* counts 1ms timeTicks */
+
void SysTick_Handler(void) {
+
msTicks++; /* increment counter */
+
}
+
+
/*----------------------------------------------------------------------------
+
SysTick_Handler (RAM)
+
*----------------------------------------------------------------------------*/
+
volatile uint32_t msTicks_RAM = 0; /* counts 1ms timeTicks */
+
void SysTick_Handler_RAM(void) {
+
msTicks_RAM++; /* increment counter */
+
}
+
+
/*----------------------------------------------------------------------------
+
MAIN function
+
*----------------------------------------------------------------------------*/
+
int main (void) {
+
uint32_t i;
+
+
for (i = 0; i < VECTORTABLE_SIZE; i++) {
+
vectorTable_RAM[i] = __Vectors[i]; /* copy vector table to RAM */
+
}
+
/* replace SysTick Handler */
+
vectorTable_RAM[SysTick_IRQn + 16] = (uint32_t)SysTick_Handler_RAM;
+
+
/* relocate vector table */
+ +
SCB->VTOR = (uint32_t)&vectorTable_RAM;
+
__DSB();
+ +
+
SystemCoreClockUpdate(); /* Get Core Clock Frequency */
+
SysTick_Config(SystemCoreClock / 1000ul); /* Setup SysTick Timer for 1 msec */
+
+
while(1);
+
}
+
+
+ + + + -- cgit