我一般这么做:
#ifdef VECT_TAB_FLASH
// Set the Vector Table base address at 0x08000000
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#elif VECT_TAB_RAM
// Set the Vector Table base address at 0x20000000
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else
#error "either VECT_TAB_FLASH or VECT_TAB_RAM should be defined"
#endif