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.
Tool/software: TI C/C++ Compiler
Hello,
I am using F28388D controller, i wanted to check the default value of a global variable in debug mode by adding it in watch expression window when the cpu is halted at main after loading the build.
i have create a global variable as below
int globa_t;
when i add this variable in watch expression of CCS v10.1.0, it displays as identifier not found, what could be the reason ?
any specific update i need to do in Linker cmd file ?
It does not throw any errors or warnings when compiled.
Nagesh,
Hope you are sure the variable still exists ? may be look at the .map file and make sure that the variable is seen.
BTW image you uploaded doesn't show-up.
Hi Karthik,
What i have observed is if the global variable is just declared and is not initialized it will not be recognized by the compiler may be its discarding from the executable. When i just made the variable to be used in my program it was working fine.
But i did not face this issue when working with F28379D controller .
Can you please let me know how can i achieve it to use by just declaring and not initializing it.
thanks,
Nagesh
From what I can see, if the variable gets optimized by the compiler, its not going to be displayed that's logical. This is the reason I asked you to check on the .map file.
I still do not understand your use-case on whats that you are intending to achieve by keeping a variable that is not being used ?
Hi Karthik,
we are developing separate modules which may not be using all of them since this was working fine in F28379D , this will add up our work when integrating everything.
thanks,
Nagesh
Okay, I'll get someone from our compiler team to have a look at this.
In the interim please help with the exact CCS and compiler version that you are using ?
Do you build for the newer EABI by building with the compiler option --abi=eabi?
Thanks and regards,
-George
Hi George,
Yes, i did verify the newer version has --abi=eabi in my compiler options
"-v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 -Ooff --advice:performance=all --define=DEBUG --define=CPU1 --define=_FLASH -g --diag_warning=225 --display_error_number --gen_func_subsections=on --abi=eabi -z -m"F28388D_Base_Core1_v1.map" --stack_size=0x200 --warn_sections -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/lib" -i"C:/ti/ccs1010/ccs/tools/compiler/ti-cgt-c2000_20.2.1.LTS/include" --reread_libs --define=CPU1 --define=FLASH --display_error_number --xml_link_info="F28388D_Base_Core1_v1_linkInfo.xml" --entry_point=code_start --rom_model"
thanks,
Nagesh
The answer in this post presumes you build with the new EABI, and not the older COFF ABI.
NAGESH RK said:i have create a global variable as below
int globa_t;
when i add this variable in watch expression of CCS v10.1.0, it displays as identifier not found, what could be the reason ?
It is likely that there are no references to the global variable globa_t. Thus, the compiler removes it. To override this behavior, apply #pragma RETAIN to the variable. For details, please see the Conditional Linking part of the article C2000 Migration from COFF to EABI.
Thanks and regards,
-George