[M2351] Support __vector_table instead of __vector_handlers in IAR

pull/7302/head
cyliangtw 2017-07-04 11:34:18 +08:00 committed by ccli8
parent 1f27546480
commit c5494eb751
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 val=0;
@ -407,4 +408,5 @@ __asm {
MOV val, R0
}
return val;
}
}
#endif

View File

@ -19,8 +19,11 @@
#endif
#if defined(__ICCARM__)
extern void *__vector_table; /* see startup file */
#else
extern void *__vector_handlers; /* see startup file */
#endif
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(__ICCARM__)
SCB->VTOR = (uint32_t) &__vector_table;
#else
SCB->VTOR = (uint32_t) &__vector_handlers;
#endif
#endif
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
TZ_SAU_Setup();