使用hal库如何设置STM32的向量表位置?
现在项目想要使用rt-thread+ hal库,但rt-thread中的例程用的是3.5标准库,在修改的过程中遇到如下代码,但没有在hal库中找到对应的方法。void NVIC_Configuration(void)
{
#ifdefVECT_TAB_RAM
/* Set the Vector Table base location at 0x20000000 */
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else/* VECT_TAB_FLASH*/
/* Set the Vector Table base location at 0x08000000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#endif
}
为了保证其原功能不变,我该如何修改呢?
(MCU是 STM32F103)
直接使用下面的代码偏移
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
creep 发表于 2017-3-23 16:10
直接使用下面的代码偏移
多谢
已经找到这段代码的出处 system_stm32f1xx.c
页:
[1]