找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 1157|回復(fù): 2
收起左側(cè)

求教STM32單片機(jī)中斷向量表偏移問(wèn)題

[復(fù)制鏈接]
回帖獎(jiǎng)勵(lì) 5 黑幣 回復(fù)本帖可獲得 5 黑幣獎(jiǎng)勵(lì)! 每人限 1 次
ID:809988 發(fā)表于 2023-4-10 15:21 | 顯示全部樓層 |閱讀模式
1.png
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代碼開(kāi)頭添加VectorBase_Config函數(shù)開(kāi)機(jī)無(wú)法正常運(yùn)行

在啟動(dòng)文件里面添加(                                DCD     0                              ; Reserved)  這行代碼就可以運(yùn)行了,
有哪位大佬能解釋一下為什么要添加(                                DCD     0                              ; Reserved)嗎,萬(wàn)分感謝
回復(fù)

使用道具 舉報(bào)

ID:883242 發(fā)表于 2023-4-10 19:18 | 顯示全部樓層
應(yīng)該檢查一下map文件,看看__Vectors后面跟著什么代碼,是不是發(fā)生沖突了?
回復(fù)

使用道具 舉報(bào)

ID:354759 發(fā)表于 2023-4-15 13:45 | 顯示全部樓層
有結(jié)論嗎,我試著修改了stm32的啟動(dòng)文件,沒(méi)有類似的問(wèn)題
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表