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.
Part Number: MSP430FR6820
We use MSP430FR6820 and need to create global variables on certain memory locations in RAM to be in a row without gaps.
There is definition of globalvar.h
If I include this globalvar.h once, everything is O, but if I include this globalvar.h twice, I have errors:
Description Resource Path Location Type symbol "Var1ToSafe" redefined: first defined in "./adc2temp.obj"; redefined in "./main.obj" symbol "Var1ToSafe" redefined: first defined in "./adc2temp.obj"; redefined in "./main.obj" main.c /TestLinkovani C/C++ Problem
Please, can you give advice how to solve this problem?
(This globalvar.h is only example, I need declare 100 variables with diferent types and I can´t use structure or another solution of datatyping, I need variables in a row on the certain address in RAM).
Thanks for your feedback and help.TI Customer
Your .h file contains variable definitions. There should only be one definition of any (global) variable in the program, typically in a .c file. The corresponding .h file should contain only declarations, something like "extern char Var1ToSafe;". Though CCS "cc" User Guide (SLAU132S) Sec. 5.12.21 doesn't say it explicitly, its examples only apply #pragma LOCATION to definitions, so they would only appear in the .c file. I expect the linker figures it out.
[Edit: Have you considered bracketing your variable group with #pragma SET_DATA_SECTION(), and then modifying your linker file to place that section where you want it? That won't set the precise location for each variable, but it will put them in the area of memory you want. And it will save some typing.]
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Bruce McKenney47378:
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.