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.

CCS/MSP430F2274: Placing new software breakpoint clears GIE, preventing interrupts from triggering

Part Number: MSP430F2274
Other Parts Discussed in Thread: MSP-FET, CCSTUDIO

Tool/software: Code Composer Studio

MCU :MSP430F2274

CCS: 7.4.0.00015

Debugger: MSP-FET430UIF

Under Debug options, I do not have any of the "Disable interrupts" options checked.

Note:

1. Only software breakpoints cause this issue. Hardware breakpoints, which the MSP430F2274 only seems to have one available for user placement, do not cause any issues.

2. It is the act of placing the software breakpoint that clears the GIE. Once the software breakpoint is placed, if I manually set GIE to 1 the interrupts will resume triggering normally.

3. The software breakpoint must be placed while the program is outside the ISR in order for GIE to be cleared. If it is placed while the program is inside the ISR, the GIE is already 0 and will correctly return to 1 when the ISR returns (the value stored on the stack).

EDIT: Initially I thought the software breakpoint had to be placed inside the ISR in order for the problem to occur, but that is not the case. Placing a software breakpoint anywhere (while the program is outside an ISR, so the SR register is not backed up in the stack) will clear the GIE and prevent interrupts.

  • Hello ForFunAndProfit,

    This is a strange issue. I'll have to get our Tools team experts involved on this one. We should be able to get back to you by next Wednesday for an update.
  • Hi,

    can you please check if resolution in this thread works for you?
    e2e.ti.com/.../717946

    Thanks and best regards,
    Andre
  • The thread that you linked to describes a different problem. It deals with the fact that stepping through code does not trigger ISRs, even when the debug options are set to allow it. That is not what this thread is about, however.

    The problem I'm experiencing is that placing a breakpoint clears the GIE bit. Single stepping through the code does NOT cause this.

  • What's the status on this, Jace?

  • Hello,
    Sorry for the delayed response. I have not been able to reproduce this issue on both CCS 7.4 or 8.2 with my MSP430F2274 target. The act of setting a software breakpoint does NOT clear GIE in any instance and interrupts are triggered normally.

    Can you provide a reproducible test case? A simple project that can reproduce the issue would be great. I just need the generated *.out file and related source files, along with instructions on how to run the example and where SW breakpoints should be set.

    Thanks
    ki
  • Hi Ki,

    I'm attaching an example project to this post. There are instructions on how to use it in the main.c file. It's a counter that increments off of a timer ISR. When the program is run without breakpoints, it increments normally. If you start adding breakpoints where the instructions indicate, the ISR won't trigger and the counter won't increment.

    Breakpoint_GIE_Project.zip

  • Thank you for putting together the test case and your clear instructions. I tried to reproduce by following your steps as stated in the comments:

    // First run the program, then pause it after a few seconds. The value of the uint16_t counter will have changed.

    // Then restart the program and place a breakpoint on the nop() line to ensure the program pauses outside the ISR.

    // Then, while the program is paused at the nop() line, place an ADDITIONAL breakpoint on the while() line.

    // Resume the program, and when it pauses, remove all breakpoints resume the program one last time.

    // The counter won't increment this time. Placing a breakpoint in the ISR will show that the ISR is never entered.

    However, I don't think I was able to reproduce the issue. It could be that I didn't understand a step of something. I recorded a video of my attempt. Please let me know if I missed something or misunderstood a step.

    /cfs-file/__key/communityserver-discussions-components-files/166/msp_5F00_sw_5F00_bp.zip

    Thanks

    ki

  • Just to note that I also tried the same steps in CCSv7.4.0 and had the same exact result as shown in my attached video (which used CCSv8.2.0)
  • Hi Ki,

    Thanks for the video, it looks like we're getting different results while following the same steps. I've uploaded a video of my own that shows the issue occurring on my end.

  • What version of the MSP430 tool chain do you have?

    Thanks

    ki

  • Thanks. I tried updating to the same version but still no luck in reproducing.

    (grasping at straws here) - can you try cleaning the IDE and workspace?
    software-dl.ti.com/.../ccs_troubleshooting.html

    And also the .launch and target cache files?
    software-dl.ti.com/.../ccs_troubleshooting.html

    If that fails to help, please reproduce the issue with debug server logging enabled. The zip the generated log and attach it to this thread
    processors.wiki.ti.com/.../Troubleshooting_CCSv7

    Thanks
    ki
  • Hello,
    Just wanted to see if you had a chance to try the suggestions I mentioned above.

    Thanks
    ki
  • Hi Ki,

    I created the example program above in a new workspace and project, and I also cleaned the IDE at the time.

    When I get some time to work on this again I'll get you the log you asked for.

  • Hello,
    Just following up to see if you were able to generate that log.

    Thanks
    ki
  • Ki-Soo Lee said:
    If that fails to help, please reproduce the issue with debug server logging enabled. The zip the generated log and attach it to this thread
    processors.wiki.ti.com/.../Troubleshooting_CCSv7

    Using the Breakpoint_GIE_Project.zip project I was able to repeat the problem using:

    - CCS 8.2.0.00007 running on Unbutu 18.04
    - MSP-FET
    - MSP430F2274
    - MSP Debug Probe drivers 8.1.1 com.ti.msp.debug_probe.feature.group (MSPDebugStack 3.13.0.1)
    - Debug Server 8.2.0.1409 com.ti.ccstudio.debugserver.linux.feature.group

    The attached zip file contains the debug server log and a video. The SR register was displayed on the Expressions view so could see the point at which the GIE flag was unexpectedly cleared, which happens about 27 seconds into the video at the point place a 2nd breakpoint on the while line (when was already a breakpoint on the _nop line).

    Breakpoint_clears_GIE.zip

  • Chester Gillon said:
    The attached zip file contains the debug server log and a video.

    The following is a filtered set from the debug_server.log to try and show the interactions between setting breakpoints and the GIE flag:

    $ egrep "(GTI R: GTI_READREG_64\( 0x00007FF91C022520, 0x0000000000000002|MSP R: MSP430_Reset|GTI R: GTI_[SG]ETBP_EX|MSP R: MSP430_EEM_[GS]etBreakpoint|GTI R: GTI_WRITEREG)" debug_server.log 
    0x7FFA1C1E6700 1496457 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ffa0ebcf060 = 4, 0x7ffa1c1e4af0 ) = 0
    0x7FFA1C1E6700 1498923 3 MSP430 GTI R: GTI_WRITEREG_64( 0x00007FF91C022520, 0x0000000000000000, 0x00000079, 0x00000000000081F8, *0x00007FFA1C1E4AE0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1499428 3 MSP430 MSP R: MSP430_Reset( 1, 0, 0 ) = 0
    0x7FFA1C1E6700 1500375 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff91c46d7c0 = 5, 0x7ff91c152e10 ) = 0
    0x7FFA1C1E6700 1500391 3 MSP430 MSP R: MSP430_EEM_GetBreakpoint( 5, 0x7ffa1c1e3ea0 ) = 0
    0x7FFA1C1E6700 1500393 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff91c14e550 = 5, 0x7ffa1c1e3ea0 ) = 0
    0x7FFA1C1E6700 1500580 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501844 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501861 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501867 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501869 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501870 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501870 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501871 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1501872 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504339 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504420 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504429 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504445 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504448 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504451 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504452 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504453 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504454 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1504454 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1507668 3 MSP430 GTI R: GTI_WRITEREG_64( 0x00007FF91C022520, 0x0000000000000000, 0x00000079, 0x00000000000081F8, *0x00007FFA1C1E4AE0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508186 3 MSP430 MSP R: MSP430_Reset( 1, 0, 0 ) = 0
    0x7FFA1C1E6700 1508284 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff98002e860 = 5, 0x7ff9980e5280 ) = 0
    0x7FFA1C1E6700 1508296 3 MSP430 MSP R: MSP430_EEM_GetBreakpoint( 5, 0x7ffa1c1e3ea0 ) = 0
    0x7FFA1C1E6700 1508298 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff91c255b20 = 5, 0x7ffa1c1e3ea0 ) = 0
    0x7FFA1C1E6700 1508303 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508324 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508415 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508426 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508442 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508444 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508446 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508449 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508449 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508450 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1508450 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000003, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA24258700 1511391 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff9980b47b0 = 5, 0x7ff9980dcfd0 ) = 0
    0x7FFA1C1E6700 1512638 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512678 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512690 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512713 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512717 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512719 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512720 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512720 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512721 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1512722 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x000000000000000C, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA24258700 1514994 3 MSP430 MSP R: MSP430_EEM_SetBreakpoint( *0x7ff9980e3440 = 0, 0x7ff998069d70 ) = -1
    0x7FFA1C1E6700 1515295 3 MSP430 GTI R: GTI_SETBP_EX( 0x00007FF91C022520, 0x000081B6, 0x00000000, 0x00000001, 0x00000000 ) = 0x00000000
    0x7FFA1C1E6700 1515561 3 MSP430 GTI R: GTI_SETBP_EX( 0x00007FF91C022520, 0x000081C0, 0x00000000, 0x00000001, 0x00000000 ) = 0x00000000
    0x7FFA1C1E6700 1516613 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516657 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516709 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516721 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516725 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516726 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516727 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516727 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516728 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000
    0x7FFA1C1E6700 1516728 3 MSP430 GTI R: GTI_READREG_64( 0x00007FF91C022520, 0x0000000000000002, 0x00000079, *0x00007FFA1C1E49E0 = 0x0000000000000004, *0x00007FFA1C1E4AA0 = 0 ) = 0x00000000

    The GTI_READREG_64 lines are reading the SR register (register number 0x2 from ccsv8/ccs_base/common/targetdb/drivers/TI_reg_ids/MSP430_regids.xml), where GIE is bit 3 so mask 0x8. The sequence around the point GIE is unexpectedly cleared is:

    a. Line 53 has the GIE bit set in SR.

    b. Line 54 is a call to MSP430_EEM_SetBreakpoint, which returns the error "Insufficient resources" (presumable since both MSP430F2274 hardware breakpoints are in use).

    c. Lines 55 and 56 are calls to GTI_SETBP_EX which set a software breakpoint. Looking in detail in the debug_server.log shows GTI_SETBP_EX calling MSP430_Memory() and MSP430_Erase() which is presumably reprogramming the flash to insert software breakpoints.

    d. Line 57 has the GIT bit cleared in SR, which suggests the act of setting a software breakpoint incorrectly cleared the GIE bit.

    From the debug_server.log can't see what causes the GIE to be cleared, so will try and look at the MSPDebugStack.

  • Chester Gillon said:
    d. Line 57 has the GIT bit cleared in SR, which suggests the act of setting a software breakpoint incorrectly cleared the GIE bit.

    From the debug_server.log can't see what causes the GIE to be cleared, so will try and look at the MSPDebugStack.

    I built MSPDebugStack 3.13.0.1 from the source in slac460y and found the following code in the FlashMemoryAccessBase::erase() function in DLL430_v3/src/TI/DLL430/FlashMemoryAccessBase.cpp is clearing the GIE bit when flash is erased as part of setting a software breakpoint:

    	if (mm)
    	{
    		/* FLASH31 workaround */
    		CpuRegisters* cpu = mm->getCpuRegisters();
    		if (!cpu)
    		{
    			return false;
    		}
    		cpu->fillCache(2, 1);
    
    		uint32_t sr = 0;
    		cpu->read(2, &sr, 1);
    
    		// disable GIE on target
    		sr &= ~ (0x08);
    
    		cpu->write(2, &sr, 1);
    		cpu->flushCache();
    	}

    I used the native Eclipse to attach to ccsstudio so could debug the libmsp430.so, and the following shows it is the FlashMemoryAccessBase::erase() function changes the SR register from 0xc to 0x4 which matches the observed behaviour the debug_server.log above:

    There is also the same code block in the FlashMemoryAccessBase::doWrite() function called during setting a software breakpoint also clears the GIE bit (by the time FlashMemoryAccessBase::doWrite is called GIE has already been cleared by FlashMemoryAccessBase::erase):

    	if (mm)
    	{
    		/* FLASH31 workaround */
    		CpuRegisters* cpu = mm->getCpuRegisters();
    		if (!cpu)
    		{
    			return false;
    		}
    		cpu->fillCache(2, 1);
    
    		uint32_t sr = 0;
    		cpu->read(2, &sr, 1);
    
    		// disable GIE on target
    		sr &= ~(0x08);
    
    		cpu->write(2, &sr, 1);
    		cpu->flushCache();
    	}

    My comments are:

    1) If the GIE is disabled as a work-around for FLASH31 when setting a software breakpoint, shouldn't the original state of GIE be restored after the software breakpoint has been set?

    Not sure if that can be done in just the MSPDebugStack, or would need to be done in the CCS debug server which calls the MSPDebugStack.

    2) The problem of GIE being cleared when setting a software breakpoint was found on a program for a MSP430F2274. However the FLASH31 errata is not listed against a MSP430F2274, and FLASH31 only appears to listed against MSP430F5xxx and MSP430F6xxx devices. Should the MSPDebugStack only be applying the FLASH31 work-around for the device families which have the errata?

  • Chester,
    Thank you for your usual thorough analysis. I'm still unable to reproduce the issue myself. I am using the F2274 on the eZ430-RF2500. Which target are you using?

    In any case, the MSPDebugStack is developed by the MSP team. I will bring this thread back to their attention so they can comment

    Thanks
    ki
  • Ki-Soo Lee said:
    I am using the F2274 on the eZ430-RF2500. Which target are you using?

    I used an Olimex MSP430-H2274, which has a 14-pin JTAG connector which was connected to a MSP-FET.

    I found a eZ430-RF2500 so could try and repeat the test on that.

    I think the eZ430 and MSP-FET use different implementations in the MSP Debug Stack, so the issue could depend upon the type of emulator used.

  • Chester Gillon said:
    I found a eZ430-RF2500 so could try and repeat the test on that.

    If you can try that, it would be very much appreciated. Thanks!

  • Chester Gillon said:
    I found a eZ430-RF2500 so could try and repeat the test on that.

    Repeating the test using CCS 8.2.0.00007 under Windows 10 Pro with:
    - Debug Server 8.2.0.1409 com.ti.ccstudio.debugserver.win32.feature.group
    - MSP Debug Probe drivers 8.1.1 com.ti.msp.debug_probe.feature.group (contains MSPDebugStack 3.13.0.1)

    The results of different emulators are:

    Emulator / target Result
    eZ430-RF2500 with its MSP430F2274 Placing a software breakpoint doesn't clear GIE
    MSP-FET430UIF with Olimex MSP430-H2274 Placing a software breakpoint clears GIE
    MSP-FET with Olimex MSP430-H2274 Placing a software breakpoint clears GIE
  • Thanks Chester! It explains why I didn't see the issue. This issue is under investigation by the device experts.
  • Hello All,

    Our Tools experts are out on holiday currently. I'll have to follow up with them next week. Look for an update around Wednesday.
  • Hello,

    Sorry for the late reply here. I'm still working with our Tools team to see why there are different behaviors here. I will hopefully have some kind of answer by end of the week.
  • Thanks Jace.

    Excellent work Chester, your efforts are greatly appreciated.

  • Hello All,

    It seems this issue is related to the following E2E post mentioned earlier. e2e.ti.com/.../717946

    From my understanding, we are looking into how to address this in a future release. As far as the discrepancy between programmers/debuggers and boards are concerned, the different behavior can be attributed to the fact that the eZ430-RF2500 uses the legacy version 2 Debug Stack software.

    i will be marking this as "TI Thinks Resolved" for now as there is no further help TI can currently provide in addition to what has been discussed already.
  • Jace H said:
    It seems this issue is related to the following E2E post mentioned earlier. e2e.ti.com/.../717946

    No, the two issues are not related.

    Jace H said:
    From my understanding, we are looking into how to address this in a future release.

    Chester identified the source of the issue earlier in this thread: code in libmsp430.so clears the GIE bit during a flash erase/write operation (which occurs when setting a software breakpoint) and then neglects to restore its original state. The solution has been found: a temporary variable should store GIE's value before it's erased and then assigned back to GIE when the operation is completed. What does "we are looking into how to address this in a future release" mean? Will the solution Chester identified be implemented or not?

    Jace H said:
    i will be marking this as "TI Thinks Resolved" for now as there is no further help TI can currently provide in addition to what has been discussed already.

    Since the issue has not been resolved, and TI has offered no ETA, I must mark the thread "This did NOT resolve my issue". I started this thread 2 months ago and if it weren't for Chester (a volunteer!) I would be no closer to solving the problem. When a patch resolving the issue is released I will be happy to mark the issue as resolved.

**Attention** This is a public forum