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.

[Concerto] Usage of the CtoM RAM

Hi.

In my code, I try to use this simple condition in my function:

    if (var1 - Ctom.var2 > CONST1)
    {
        var3 = var4 - var5;  //Line 1
        var6 = var7;    // Line 2
        ++Ctom.var8;

},

where Ctom is the structure that placed in the CtoM RAM:

struct TCtom Ctom;
#pragma DATA_SECTION(Ctom, ".ctomsec");

where .ctomsec is:

   .ctomsec            : > CTOMRAM,                    PAGE = 1

The function above has very strange behaviour. For example, when var1 == Ctom.var2 == 14 and lower than CONST1 == 300, the " if (var1 - Ctom.var2 > CONST1)" condition unexpectably became true. When I try to debug this situation and place the breakpoint at the line named "Line 1", the breakpoint is never achieved. But when I place the breakpoint at the line named "Line 2", the breakpoint is always achieved, however, all the variables that shown in a Watch window or highlighted under cursor have expectable values that I wrote above.

It looks like the CtoM memory cannot be used for placing ordinary variables? Or comparison operations in this RAM are forbidden? Or this is the bug in the debugger itself? Or what? So strange to see the different behaviour of breakpoints at line 1 and line 2.

This code is for the DSP part of the Concerto microcontroller.

UPD: The CtoM RAm is not a reason of this issue. I move the Ctom struct to other memory and got the same issue. Both variables in comparison are unsigned short. And there is one another thing: the program fetches to the ILLEGAL_ISR interrupt right from this condition when run. It don't fetched if there is one NOP operation before this condition. It don't fetched from step-by-step debugging. I don't understand what does it mean and will continue working around.