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.

MSP430F5638: CCS v10 Program stalls on Step Return Arrow and runs correctly on Terminate, can't single step

Part Number: MSP430F5638
Other Parts Discussed in Thread: MSP-FET

Using CCS v10 and an MSP430F5638 running on a custom SBC driving an LCD. Code, board, and LCD were running fine. Using MSP-FET to program the MCU.

Normal use:

Build code ok, Run Debug and the program used to run fully from the Step Return Arrow, then pick the Terminate button to exit the debugger and return to the IDE.

Current use:

Press Step Return Arrow and LCD shows junk, and program stalls, then pick Terminate and the program runs completely and correctly, showing correct data on the LCD.

Why is the behavior different?

Also I can't single step into the program, getting the following error message:

MSP430: Can't Single Step Target Program: Could not single step device

  • Hello,

    I've seen issues when single-stepping across LPMx entries or exits. Also, the MSP430F5638 has the Port15 errata that's related to single-stepping over code related to port mapping controller registers. See the erratasheet for more details.

  • Hi James,

    Thanks for the reply. The 5638 only supports port mapping on P2, which is not being setup or used in this specific test program. Also don't think I'm using any LPM modes in this test code. I'll look at the Port15 errata sheet.

  • That's good to know. The code that you're trying to step over could be a hint too. I supported another customer recently who was experiencing issues single-stepping code and turns out, they were re-declaring the LPM entry/exit intrinsics using #define and we discovered that the macros do not work reliably with arguments. Another contribution to the issue could have been that the intrinsics use assembly code.

    MSP430F5249: Program counter is corrupted when setting breakpoint in timer ISR

  • Not using any assembly code, not redefining any intrinsics, not using any macros so far, although will be replacing some functions with macros later in development. I'm suspicious of the MSP-FET, is there a way to reset or test it?

  • I've discovered what is causing the Step Return Arrow - program stalls, LCD shows snow - pick Terminate and the program runs fine - problem. It's the Load Program error, or some variation like "MSP430: Error connecting to the target: Unknown device". With everything started fresh: PC, CCS, custom SBC & power supply, MSP-FET I can get about 6 Build, Run, Debug cycles where the Step Return Arrow and Terminate buttons work properly, once I get some scrambled communications, this problem starts up again. Shutting everything down, and restarting, fixes it for a while, then the problem resumes.

  • Thought it might be an intermittent USB problem on my main computer, so moved the custom SBC and MSP-FET to my lab and used my 10 yr old laptop. Same custom SBC, MSP-FET & USB cable, code, different power supply and computer. Went through 8 successful Build Run Debug cycles before the first program load error, but it recovered ok, ran, and did not cause the Step Return button problem. But after an additional successful 6-8 Build Run Debug cycles, it got the scrambled communication problem again, and after this one, it now has the Step Return Arrow problem: LCD with snow, program stalled, must hit Terminate to run it successfully. Not an intermittent USB problem.

  • Thanks for the detailed update. Can you try replicating this behavior using one of our code examples or a simplified version of your project? If so, then I could try replicating this behavior on my side. Is there a specific line of code that seems to cause the issue?

  • This is caused by some type of communication problem between: CCS | Run | Debug | USB | MSP-FET | JTAG | MSP430F5638 flash memory. If I power everything down and back up again, it usually clears it. Also the program seems to run fine from the Terminate button. And roughly 7 out of 8 times it runs fine - does not have the problem. It's not tied to any specific line of code. 

    I repeat my original query: is there a way to test or reset the MSP-FET?

  • This is caused by some type of communication problem between: CCS | Run | Debug | USB | MSP-FET | JTAG | MSP430F5638 flash memory.

    That may be a possibility. Are you using a USB hub?

    If I power everything down and back up again, it usually clears it.

    Do you leave CCS open? Do you unplug the MSP-FET from your PC and your board?

    Also the program seems to run fine from the Terminate button.

    So you're saying that after clicking the red Terminate button and ending the debug session, the code works fine free-running.

    I repeat my original query: is there a way to test or reset the MSP-FET?

    Not formally. You could try the recovery process mentioned in the MSP Debuggers User's Guide, but that may not help unless your MSP-FET's firmware is out of date.

  • Not using a USB hub, direct connection to PC.

    Powering everything down means: turn off power supply to custom SBC, unplug the MSP-FET from USB, close CCS. Then reconnect power supply to custom SBC, plug MSP-FET back into USB, restart CCS.

    If the Step Array stall occurs, the program then runs fine after picking the Terminate button.

    I think I found the problem. There is an optional jumper in the JTAG circuit for powering the circuit from the MSP-FET probe (limited to 60 ma) or from the SBC power supply. Since the SBC draws 150+ ma, I place the jumper. But the SBC has its own power supply, so I tried removing the jumper, and so far, the problem has not occurred again (but that's only 1.5 days of building and running the code). My 430 JTAG circuit matches Fig. 2-1 in the MSP430 Hardware Tools Users Guide, p. 21.

    I think we can close this issue, the Step Return arrow problem is caused by the Load Program issue. It seems like the local JTAG FET circuit is happier when it uses its own power.

  • But the SBC has its own power supply, so I tried removing the jumper, and so far, the problem has not occurred again

    Make sure VCC_TARGET is connected to the MSP-FET when powering the device with external power. This senses the voltage levels for the JTAG signals. It sounds like there was a potential power supply conflict. I'm glad you figured it out.

  • Thanks for you help James

  • You're welcome. Thanks for updating the other thread - much appreciated. Let us know if you have any more issues.

    MSP430F5638: Load Program Error

**Attention** This is a public forum