工具与软件:
您好!
我目前正在评估 MSPM0G3507。
当我在 CCS (v12.8.1)中启动调试会话时、我注意到"Registers"视图中缺少 SCB 寄存器。
但是、当我在"Expressions"视图中添加表达式"(SCB_Type*)(0xE000E000UL + 0x0D00UL)"时、我可以很好地检查所有 SCB 寄存器(包括我感兴趣的 VTOR)。
是否存在此寄存器在"Registers"视图中不可用的原因?
谢谢!
Markus
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.
工具与软件:
您好!
我目前正在评估 MSPM0G3507。
当我在 CCS (v12.8.1)中启动调试会话时、我注意到"Registers"视图中缺少 SCB 寄存器。
但是、当我在"Expressions"视图中添加表达式"(SCB_Type*)(0xE000E000UL + 0x0D00UL)"时、我可以很好地检查所有 SCB 寄存器(包括我感兴趣的 VTOR)。
是否存在此寄存器在"Registers"视图中不可用的原因?
谢谢!
Markus
您好、Diego:
感谢您的快速响应。
我认为这里有一个误解:
在项目中设置 VTOR 寄存器值非常有效。
我很好奇、在 Code Composer Studio Debug Mode (使用调试器连接到目标时)下、"Registers"视图未命中 SCB 寄存器。 屏幕截图: https://ibb.co/WWnZ9JXH
但是、如果我在 CCS"Expressions"视图中添加 SCB 基址(使用正确的转换类型)、我可以查看一些可访问的 SCB 寄存器。
屏幕截图: https://ibb.co/21pmCyLH
但是、如果您感兴趣、我可以使用链接器脚本符号为 VTOR 分配以下简单代码(我使用裸机、无 RTOS)、该符号指向应用程序中的矢量表地址(我使用引导加载程序/应用程序设置)。
链接器脚本:
/* Aligns the interrupt service table to a 256-byte boundary and stores the address in a linker symbol */
.intvecs: palign(256) { _intvecs_location = .; } > FLASH_APPLICATION
C 语言代码:
/* Interrupt vector table location from linker symbol */
extern uint32_t _intvecs_location;
void initInterruptVectortable(void)
{
SCB->VTOR = (uint32_t)&_intvecs_location;
}
此致、
Markus