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/CC2640: How to view static variable

Part Number: CC2640

Tool/software: Code Composer Studio

I am using Version: 7.0.0.00043 and not able to view any "static" variable.  Only able to view local variable.

Is there a way to examine Static  ?

  • Hello,
    Can you try adding it to the Expressions view?

    thanks
    ki
  • Dilbert K said:
    Is there a way to examine Static  ?

    For file statics, you can use a syntax in the expressions view like: '<file name>'::<static var name> (e.g. 'peripheral.c'::testvar2)

    [Found on this thread https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/70217/255694#255694]

  • I had tried "expressions" tab, it shows the Variable on drop down menu when I typed.

    However, after enter, it always shows "identifier not found"

    Looks like some formatting is missing or something

  • Dilbert K said:
    However, after enter, it always shows "identifier not found"

    I tested CCS 7.3.0.00019 with a Cortex-A8 program built with the GNU v6.3.1 compiler.

    A source file named sdram_test_main.c had two static variables, one at file scope and another with function scope:

    static uint32_t file_scope_var = 1;
    
    static void inc_static_var (void)
    {
        static uint32_t function_scope_var;
    
        function_scope_var = file_scope_var;
        file_scope_var++;
    }

    In the expressions entered the variables twice:

    a) Just using the variable name.

    b) Qualifying the expression as:

    '<source_filename>'::<variable_name>

    When the debug context was in a function in the source file with the static variables, both types of expression displayed the value of the variables:

    When the debug context was in a function in a different source file the expressions with just the variable name showed "identifier not found", but the expressions qualified with the file names did display the values:

    Do you still get "identified not found" even when qualifying the expression with the name of the source file?

  • I tried below format 

    int8_t testing=88;

    'main.c'::testing 

    and it only work without "static" being defined in variable. 

    Once static is defined, then it shows "identifier not found"

    I wonder some setting in the CCS tools in build options, I need to enable

  • Dilbert K said:
    I wonder some setting in the CCS tools in build options, I need to enable

    Which compiler are you using?

  • I am using ARM compiler

  • Hello,
    Sorry for the delayed response on this. I am unable to reproduce this issue using the TI ARM compiler 16.9.4 LTS and with CCSv7.3.0. The method as mentioned by Chester works as expected. Can you provide a small reproduce test case of a project with source files and built *.out file that i can try? It can be a very simple example (the simpler the better), just as long as the issue can be reproduced.

    Thanks
    ki
  • Hello,
    I haven’t heard back from you, I’m assuming you were able to resolve your issue. If not, please post a reply with an update below (or create a new thread).

    thanks,
    ki
  • I have not resolved the issue yet...for now, I just changed to non Static to debug the code.