This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TM4C1294NCPDT:矢量表

Guru**** 2999690 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1654795/tm4c1294ncpdt-vector-table

器件型号: TM4C1294NCPDT

根据 TM4C1294 控制器的数据表、寄存器 57:矢量表偏移 (vtable)、偏移量 0xD08

我们可以更改矢量表的地址、但前 9 位是 RO(只读)、所以该程序仍然是如何工作的。

*Bootloader 程序

  __asm(“ mov r0、#0x4000\n“
     “ LDR R1、[r0]\n“
     “ MSR MSP、R1“
  );
  __asm(“ ldr r0、[r0、#4]\n“
  “ BX r0\n“);

*应用程序

HWREG (NVIC_vtable)= 0x4000;

我想我应该写

HWREG (NVIC_vtable)= 0x4000 << 10;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我删除这行代码 HWREG (NVIC_vtable)= 0x4000 << 10; 但它仍然有效。

    我认为这行代码对更改向量表的地址无关紧要。

    在 应用程序中、矢量表的程序地址将随着我更改.cmd 文件中的#define APP_BASE 0x4000 而更改。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 400;="" margin:="" 12px="" 0px="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">您好、 Soham Patel
    ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 400;="" margin:="" 12px="" 0px="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">
    ",="" arial,="" sans-serif;="" font-size:="" 20px;="" font-weight:="" 600;="" margin:="" 24px="" 0px="" 12px;="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">为什么它现在仍然可以正常工作
    ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 400;="" margin:="" 12px="" 0px="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">执行引导加载程序时 bx r0、它会直接跳转到应用程序的重置处理程序。
    ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 400;="" margin:="" 12px="" 0px="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">应用程序开始正常运行其主循环、因为 ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 600;="" margin:="" 0px;="" text-decoration:="" none;="" border-bottom:="" 0px="" rgb(10,="" 10,="" 10);"="">运行常规代码不需要矢量表。 CPU 按顺序执行指令。 只要没有发生中断、CPU 就无需查看 VTABLE 寄存器。
    ",="" arial,="" sans-serif;="" font-size:="" 16px;="" font-weight:="" 400;="" margin:="" 12px="" 0px="" text-decoration:="" none;="" border-bottom:="" rgb(10,="" 10,="" 10);"="">谢谢
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您的回复。