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.

Memory corruption while on disassembly view on FRAM series

Other Parts Discussed in Thread: MSP430F5529, MSP430FR5729, MSP-EXP430FR5739, MSP430FR5739

Hello,

I am having a very strange problem. I am using CCSv5.3.0.00090 on Windows 8. I am testing the same environment on MSP430F5529 (no problem with this), and on MSP430FR5729 (this is where I get the problem).

The problem is that on Debug view, with Disassembly view enabled (Window -> Show View -> Disassembly), the memory gets corrupted (for static variables).

To replicate the problem do as follow:

1. Create a new project for MSP430FR5729 (I used the blink example with some modifications).

The code I am running is the following:

#include <msp430.h>

int main(void) {
    WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

    for(;;) {
        static volatile unsigned int i; // volatile to prevent optimization NOTICE HERE STATIC VARIABLE

        i = 10000; // SW Delay
        do
            i--; // INSERT BREAKPOINT HERE
        while(i != 0);
    }
    return 0;
}

2. Debug the code, when it stops in the first line of main, 

3. Insert breakpoint at line "i--"

4. Open Disassembly View (Window -> Show View -> Disassembly) and leave it visible (the tab must not be hidden).

5. Add the variable i to the Expressions view (just to see the problem)

6. Resume (F8). Execution will stop at line "i--"

Now you can Resume, or single step (Step Into or Step Over), and you can see that the value of "i" in the expressions does not change (actually it changes, but changes back on next instruction) -- so it never reaches 0 (even after 10000 steps).

Now if you close Disassembly view (or just hide it, say by opening the Memory Browser or anything else on top of it), you can step and see the value in the expressions view decrementing.

I think this is a problem with CCS thinking that this memory address is not writable, as if it were on the FLASH series. Also, if you don't declare the variable as static, the problem does not happen. So maybe because CCS knows that the stack is volatile.

I think this is a bug with CCS. Please let me know if you need more information on that. I am going to test it on another computer, but I think the problem will be the same.

Regards

-- Marco Casaroli

  • Hi Marco,

    this is very odd and I have so far only been able to track down a 5529 which would not help me try and reproduce this.  Do you happen to have the v5.4 beta loaded on a system as well to see if the problem is in that newer version ?

    In the mean time I am trying to see if I can pull in a couple colleagues here.

    Best Regards,
    Lisa

  • Macro,

    I have a FR5739 and I am trying to reproduce this.  So far it is working ok for me.  I followed the steps and have the disassembly window visible and each time I run the value of i decrements by 1.  Now I am running the CCSv5.4 release candidate so that could be a key difference.  I am going to hook up my Win8 netbook as I believe I have 5.3 on it and I can see if that makes a difference.

    john

  • I see the same on my Win8 netbook with CCSv5.3.  It is working ok.   What address range is visible in your disassembly view?  I am just thinking that my screens are small and maybe I need to have a different address range visible to replicate the issue.

     

    John

  • JohnS said:
    I see the same on my Win8 netbook with CCSv5.3.  It is working ok.

    Which emulator were you using?

    With CCS 5.3 found that with the emulator built into a MSP-EXP430FR5739 it was working.

    Having now disconnected the MSP-EXP430FR5739 emulator, and debugging via a MSP-FET430UIF connected to the MSP430FR5739 with Spy-Bi-Wire I am now seing the problem where the i global variable is not being displayed correctly in the debugger. The MSP-FET430UIF hardware is V1.4a and the MSP430.dll is 3.3.0.6.

  • Chester Gillon said:
    Having now disconnected the MSP-EXP430FR5739 emulator, and debugging via a MSP-FET430UIF connected to the MSP430FR5739 with Spy-Bi-Wire I am now seing the problem where the i global variable is not being displayed correctly in the debugger.

    The cause of the problem is this thread is the same as in CCS5.3 Acting strange, which is a bug in the MSP430.dll. See the other thread for a suggested fix.