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 V5.5 Register setting errors?

I meet problems when running UART demo codes, so I set breakpoint to check registers setting. 

For example, in the following picture,  

                       P1SEL = BIT1 + BIT2 ;  should set P1SET to 0x06; but reading from Registers, it's still 0x00;.

What I did is just install CCSv5.5, import demo codes from TI Resource Explorer. 

Please help me to solve this problem.

Thank you.

  • You appear to have modified your source file since you started the debugger.

    Notably, you appear to be stopped at a comment line, which suggests that your line numbers (used by the debugger to figure out where to mark) have changed and it's unknown what line you're really on.

    Try re-building and restarting the debugger.

    More generally: if you've enabled optimization the debugger can have a very difficult time pointing to the correct line since the instructions from a single (C) code line could be scattered all over. This can't happen too much in this case since every line writes a volatile variable, but it routinely happens in general code.

  • Bruce McKenney47378 said:
    You appear to have modified your source file since you started the debugger.

    Obviously, as four lines are marked red in the editor, which means they have been changed since last compile and are not even saved (changed since last compile but saved are marked green, IIRC)

    Bruce McKenney47378 said:
    if you've enabled optimization the debugger can have a very difficult time pointing to the correct line since the instructions from a single (C) code line could be scattered all over.

    Or common parts for multiple instructions have been joined (like common subexpression elimination).
    However, you will never end up in a comment line then :)

**Attention** This is a public forum