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.

Cannot Halt CPU By Hardware Watchpoint

Other Parts Discussed in Thread: C2000WARE

Hello,

I'm trying to find out why OST is being set in EPWM10 in F28379D on a controlCARD which is under CPU2 control.

I have followed the manual:

https://software-dl.ti.com/ccs/esd/documents/ccs_breakpoint_watchpoint_c2000.html#Configure_a_Hardware_Watchpoint

...and tried to add a watchpoint for EPwm10Regs.TZFLG.OST but this fails to halt the CPU. I am using XDS100v2.

Everything seems to be correct:

Please can you advise why the CPU2 fails to halt?

Thank you.

  • Hello,

    The watchpoint seems configured correctly (assuming 0x4993 correspondes to the correct address). Do other hardware breakpoinst and watchpoints trigger correctly? If so, can you provide a test case? I just need an executable that will write to the same location.

    Thanks

    ki

  • Thanks Ki. Yes breakpoints seem to work fine.

    I double checked and address 0x4993 is correct for EPwm10Regs.TZFLG. The OST flag is bit 2.

    I think the following code should serve as a test case to set TZFLG.OST:

            EPWM_clearTripZoneFlag( EPWM10_BASE, EPWM_TZ_FLAG_OST );
            EPWM_forceTripZoneEvent( EPWM10_BASE, EPWM_TZ_FORCE_EVENT_OST);

  • I added the above code snippet to one of the example epwn examples from C2000Ware. While the exmaple builds fine, when I step through the above two lines, I don't see the flag being set. I wonder if I am missing some additional initialization. My expertise is limited to the tools itself and not the device so I am wonderinf if you can send me an example that i can run.

    Thanks

    ki

  • OK, let's try this.

    I built the project from here and ran it on controlCARD:

    C:\ti\c2000\C2000Ware_4_00_00_00\driverlib\f2837xd\examples\cpu1\led

    I added the aforementioned lines to the end of the for loop. Here's the register states before and after EPWM_forceTripZoneEvent():

    I hope you get the same.

    As per the original question, the LED carries on blinking even though I set the watchpoint to stop when this register is written to.

    I attach my whole project.led_ex1_blinky.zip

    ...

  • Just an fyi that I am working with the C2000 team regarding the above issue.

  • Thanks Ki. I'm working around it in the meantime.

  • Thank you for your patience. As soon as I have an update I will let you know.

  • I have a suggestion for an explanation of this problem. The register in question (TZFLG) is Read only so can only be modified by the silicon logic. In that context perhaps a Data Write watchpoint may not make sense because there is no write possible from the the user code.

    I say this because a watchpoint for register TBPRD does work for me. This is a writable register since the user code is expected to modify it.

    It seems that it's impossible to halt the CPU when the EPWM peripheral sets the OST flag unless somebody has an idea how to do this?

  • In that context perhaps a Data Write watchpoint may not make sense because there is no write possible from the the user code.

    You may be correct here. The data watchpoint would monitor the data bus for writes to a specific address. If the value is being changed some other way, then that could explain why the watchpoint did not trigger.

    I will bring this thread to the attention of the device experts. They can provide further assistance.

    Thanks

    ki

  • Hi Kier,

    I am able to duplicate your findings on my side as well. Hardware watchpoints work for non-read only bits but for TZFLG since it is read-only the CPU will not be halted when the breakpoint is inserted. Could be due to what you and Ki suggested.

    It seems that it's impossible to halt the CPU when the EPWM peripheral sets the OST flag unless somebody has an idea how to do this?

    Can you please provide the context behind why this is needed in your application? Maybe I can suggest another method of debug.

    Best Regards,

    Marlyn

  • Hi Marlyn,

    Thanks for the confirmation.

    The context is that OST was triggered unexpectedly when the conditions would indicate that everything was fine. So naturally I wanted to examine what was setting the flag in my code hence the watch point.

    I resorted to the ungainly method of commenting out code until the triggering stopped. I found the cause eventually and fixed it so the necessity to find an alternative is gone unless you have a smarter method in mind?

    Kier.

  • Hi Kier,

    I resorted to the ungainly method of commenting out code until the triggering stopped. I found the cause eventually and fixed it so the necessity to find an alternative is gone unless you have a smarter method in mind?

    I am glad you were able to find the issue. Unfortunately, for this use case what you did is the only way to figure that out, other than possibly single stepping through your code to see which line of code was affecting the OST bit.

    Best Regards,

    Marlyn