Fixed wedging test in 'system_stm32f7xx.c'.

This commit is contained in:
mikeller 2018-08-20 23:40:47 +12:00
parent b0ccb7ee47
commit e91231aa0e
1 changed files with 1 additions and 4 deletions

View File

@ -337,14 +337,11 @@ void SystemInit(void)
extern uint8_t isr_vector_table_base; extern uint8_t isr_vector_table_base;
const uint32_t vtorOffset = (uint32_t) &isr_vector_table_base; const uint32_t vtorOffset = (uint32_t) &isr_vector_table_base;
#define VTOR_OFFSET_ALIGNMENT 0x200 #define VTOR_OFFSET_ALIGNMENT 0x200
#define VTOR_OFFSET_MASK (VTOR_OFFSET_ALIGNMENT - 1) if (vtorOffset % VTOR_OFFSET_ALIGNMENT != 0) {
if (vtorOffset % VTOR_OFFSET_MASK != 0) {
// ISR vector table base is not 512 byte aligned // ISR vector table base is not 512 byte aligned
while (1); while (1);
} }
SCB->VTOR = vtorOffset; SCB->VTOR = vtorOffset;
#undef VTOR_OFFSET_MASK
#undef VTOR_OFFSET_ALIGNMENT
/* Enable I-Cache */ /* Enable I-Cache */
if (INSTRUCTION_CACHE_ENABLE) { if (INSTRUCTION_CACHE_ENABLE) {