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.
I'm used to programming in a Visual Basic environment, so I'm not sure if my habits are whats getting in my way, but the attached JPEG sums it up in a nutshell. I writing code for an MSP430F4 and this function takes a string and turns it into a ticker so long strings can be read out of the simple LCD.
1) When reading variables in debug mode under the Expressions tab I often see 'Identifier Not Found'. Why won't it display the variables?
2) *str_ptr is supposed to be an independent pointer, but CCS made *str_ptr and *string one in the same, R12, when I just want them to initially point to the same thing. Why is this and how do I correct it?
3) Inside the while (*str_ptr) loop I cannot for the life of me get it to execute the if statement, even after making it true! It is however iterating the loop correctly.
4) You can see the decimal variable is supposed to be set to 5, but the expressions tab says 997.
Thanks,
-Ken
By default when compiled for debug, the compiler still performs some optimizations. If you select the CCS5.1 project properties -> CCS Build -> MSP430 -> Advanced Options -> Advanced Optimizations -> Disable all high level optimization (no --high_level_opt) then when debugging you will see the expected variable values.
As written the value and decimal variables don't affect the output of the ascii_to_int function, so the compiler optimization removes the code which sets the variables, which leads to confusing results in the debugger. Shouldn't value be the output from the function, e.g. the return value?
This was working great for me, but I just updated to 5.4 and this option disappeared, how can I get it back?
With CCS 5.4 the option has changed. Under CCS Project Properties set Build -> MSP430 Compiler -> Optimization -> Optimization Level (--opt_level, -O) to "Off"Ken Trumper said:This was working great for me, but I just updated to 5.4 and this option disappeared, how can I get it back?
Can you show your code, and explain which variables have the problem.Yassine EL QOMRI said:I am having the same issue as the initial post, but my project option are already set like suggested
acqps is a local variable in the SetupADCContinuous() function with automatic storage allocation, which is allocated on the stack.Yassine EL QOMRI said:For example here, If I want a see "acqps" it doesn't recognize the expression
The value of such variables can only be displayed on the Expressions view when the debugger scope is within the function which contains the variable. The screen shot shows that the debugger scope is in the main function (the highlighted function on the call stack in the Debug window).
If you step into the SetupADCContinuous() function the expressions view should then be able to display the value of acqps .
**Attention** This is a public forum