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: Problem with assignments in code composer

Tool/software: Code Composer Studio

Hi Guys,

  I know this is unexaplinable but code composer wont even execute "=" assignment operators properly. I have attached a screenshot to show you all what i mean. Its a simple addition statement which appears not to be executing. The hardware is the MSP430G2552 launchpad.

  • Usama,

    The tooltip that is shown when you mouse-over on a variable is the declaration line.   This is why in your first example when you put the mouse on low_address it shows you "unsigned int low_address=0,high_address=0;" It is showing you both low_address and high_address as that is what the line of code looks like that declared the variable.

    If you go to the line where you have number_of_bytes_for_CRC declared you will see "unsigned int number_of_bytes_for_CRC=0;".   If you want to see the current value of a variable use either the variables view or the expressions view.

    It is also possible that the compiler will optimize out the variable depending on how your code is using it.  For example in this case you can see here that number_of_bytes_for_CRC does not automatically show up in the variables view and when I add it to the expressions view I get an identifier not found message.  

    If I want to prevent the optimizer from doing that I can just add the keyword volatile on the declaration line.

    https://barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword

    Regards,

    John