Hello,
is this possible to use software watchpoints in F28379D CPU? I'm trying to configure registers for software watchpoint based on spra820 document, but this works only partially.
Configuration registers answer correctly, for example if I have breakpoints in CCS studio I cannot set breakpoint in software. But if I configure all registers RTOSINT isn't executed.
Can anyone help me with this matter? This is my code:
file.h #define STACK_GUARD_MARGIN 50 #define STKOV_RANGEMASK 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_RANGEMASK); if ((GuardAddress < (uint32)(&StackAddressBottom)) || (GuardAddress > (uint32)(&StackAddressTop))) { asm(" ESTOP0"); StackErrorOccured(); } asm(" EALLOW"); Watchpoint1Regs.WPEVT_CNTL = 0x0001; asm(" RPT #1 || NOP"); if ((Watchpoint1Regs.WPEVT_ID & 0xC000) != 0x4000) { asm(" EDIS"); asm(" ESTOP0"); StackErrorOccured(); } Watchpoint1Regs.WPMASK = (uint32)STKOV_RANGEMASK; Watchpoint1Regs.WPREF = GuardAddress | (uint32)STKOV_RANGEMASK; Watchpoint1Regs.WPEVT_CNTL = 0x081A; IER |= 0x8000; asm(" EDIS"); /** test **/ uint32 *tst; tst = 0x07D0; *tst = 0xDEADBEEF; // <- not working, RTOSINT isn't fired
*.CMD file:
WATCHPOINT0_REGS : origin = 0x000828, length = 0x000020
WATCHPOINT1_REGS : origin = 0x000848, length = 0x000020