您好!
这是否可以在 F28379D CPU 中使用软件观察点? 我尝试根据 spra820文档为软件观察点配置寄存器、但这只能部分工作。
配置寄存器回答正确、例如、如果我在 CCS Studio 中有断点、我无法在软件中设置断点。 但是、如果我配置所有寄存器、RTOSINT 不会被执行。
有人能帮我解决这个问题吗? 这是我的代码:
file.h
#define STACK_GUARE_MARGINE 50
#define STKOV_RANGEEMASK 0x0007
struct watchpoint_regs{
uint32 WPMASK;
uint32 WPREF;
uint16 rsrvd1;
uint16 rsrvd2;
uint16 WPEVT_CNTL;
uint16 WPEVT_ID;
};
extern volatile struct watchpoint_regs watchpoint0Regs;
extern volatile struct watchpoint_regs watchpoint1Regs;
extern uint32 StackAddressBottom;
extern uint32 StackAddressTop;
extern uint32 STACKSIZE;
file.c
uint32 GuardAddress =(((uint32)(&StackAddressTop)- stack_guard_Margin)&(uint32)(~STKOV_RANGEEMASK);
if ((GuardAddress <(UINT32)(&StackAddressBottom))||(GuardAddress >(UINT32)(&StackAddressTop)))
{
asm (" ESTOP0");
StackErrorOccaled();
}
asm (" EALLOW");
Watchpoint1Regs.WPEVT_CNTL = 0x0001;
asm (" RPT #1 || NOP");
if ((watchpoint1Regs.WPEVT_ID & 0xC000)!= 0x4000)
{
asm (" EDIS");
asm (" ESTOP0");
StackErrorOccaled();
}
Watchpoint1Regs.WPMASK =(uint32) STKOV_RANGEEMASK;
Watchpoint1Regs.WPREF = GuardAddress |(uint32) STKOV_RANGEEMASK;
Watchpoint1Regs.WPEVT_CNTL = 0x081A;
IER |= 0x8000;
asm (" EDIS");
/**测试**/
uint32 * tst;
TST = 0x07D0;
* TST = 0xDEADBEEF; //<-不工作、RTOSINT 未被触发
*。cmd 文件:
WATCHPOINT0_regs :origin = 0x000828,length = 0x000020
WATCHPOINT1_REGS :origin = 0x000848,length = 0x000020