标题: 求教STM32单片机中断向量表偏移问题 [打印本页]

作者: 18862511786    时间: 2023-4-10 15:21
标题: 求教STM32单片机中断向量表偏移问题

static void VectorBase_Config(void)
{
  /* The constant array with vectors of the vector table is declared externally in the
   * c-startup code.
   */
  extern const unsigned long __Vectors[];

  /* Remap the vector table to where the vector table is located for this program. */
  SCB->VTOR = (unsigned long)&__Vectors[0];
} /*** end of VectorBase_Config ***/
在app代码开头添加VectorBase_Config函数开机无法正常运行

在启动文件里面添加(                                DCD     0                              ; Reserved)  这行代码就可以运行了,
有哪位大佬能解释一下为什么要添加(                                DCD     0                              ; Reserved)吗,万分感谢

作者: Hephaestus    时间: 2023-4-10 19:18
应该检查一下map文件,看看__Vectors后面跟着什么代码,是不是发生冲突了?
作者: 大大大熊猫    时间: 2023-4-15 13:45
有结论吗,我试着修改了stm32的启动文件,没有类似的问题




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1