Support __vector_table instead of __vector_handlers in IAR

pull/7631/head
cyliangtw 2017-07-04 11:34:18 +08:00 committed by Cruz Monrreal II
parent db10dc0207
commit e1a9492e75
2 changed files with 11 additions and 2 deletions

View File

@ -398,6 +398,7 @@ void Default_Handler(void)
} }
#if defined(__CC_ARM)
uint32_t GetPC(void) uint32_t GetPC(void)
{ {
uint32_t val=0; uint32_t val=0;
@ -407,4 +408,5 @@ __asm {
MOV val, R0 MOV val, R0
} }
return val; return val;
} }
#endif

View File

@ -19,8 +19,11 @@
#endif #endif
#if defined(__ICCARM__)
extern void *__vector_table; /* see startup file */
#else
extern void *__vector_handlers; /* see startup file */ extern void *__vector_handlers; /* see startup file */
#endif
extern uint32_t GetPC(void); /* Get current program counter(PC) */ extern uint32_t GetPC(void); /* Get current program counter(PC) */
@ -70,8 +73,12 @@ void SystemInit(void)
{ {
#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
#if defined(__ICCARM__)
SCB->VTOR = (uint32_t) &__vector_table;
#else
SCB->VTOR = (uint32_t) &__vector_handlers; SCB->VTOR = (uint32_t) &__vector_handlers;
#endif #endif
#endif
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
TZ_SAU_Setup(); TZ_SAU_Setup();