Hi Fellas,
Please help me out in the problem that, I am passing a 3D array as function argument. But instead of referencing to same location of 3D array keil microvision4.02 makes another copy to some other location and now it is duplicating the array and occupying double size in xdata memory (in which i have decalared/defined the 3D array) . At the end , I am exceeding the size of avaiable 32K memory and my program is not compiled properly.
If somwhow I be able to stop this array duplicating and save the array doubling, then I can get rid of my problem. I am using keil micorvision 4.02,TI MSC1210Y5 controller with 32k flash.
Please suggest me.
Regards
You really did manage to post a minimum of code showing what you are doing.
By now I have ( as far as I understand ) managed the above mentioned problem to some extent with few changes. But now my compilation shows no errors but alot of warnings(around 46).
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: DISCHARGECALIBRATIONPOINTS MODULE: dt_main.obj (DT_MAIN) *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: INTAKECALIBRATIONPOINTS MODULE: dt_main.obj (DT_MAIN) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: INTAKECALIBRATIONPOINTS MODULE: dt_main.obj (DT_MAIN) ADDRESS: 2B19H
What I have read that if one is able to manage warning L1, then L2 will be resolved automatically. Although I have read the relevant posts/documents but still have the problem because I am not getting the resolution posted here http://www.keil.com/support/man/docs/bl51/bl51_l1.htm
Please help me resolving warning L1.
Make sure that you include the module that includes the symbols. Make sure that the symbols have external linkage. Make sure that the symbols are correctly spelled.
Ok I will check as you mention. Please stay online on the forum. thanks
If you want peole to specifically dedicate time to you, then you will need to pay them...
http://www.keil.com/condb
I have checked 2 things (first and last) as you just mentioned in your post. But I am not getting the second thing. Could you please tell me the details as how to check the second thing.
Actually the scenario is,I have defined 2 structures and then their (extern) instances as follows,
struct PressureValues { float SetPressure; float ReadPressure; };
struct CalibrationPoints { float SetTemperature; struct PressureValues PressurePoints[10]; }; extern struct CalibrationPoints xdata IntakeCalibrationPoints[10]; extern struct CalibrationPoints xdata DischargeCalibrationPoints[10];
These are defined in main.h file and this main.h is included/linked in one more pressure.c (source) file which is also using these structure values. In short, two source files are using these structure values main.c and pressure.c!
But you do know that
extern struct CalibrationPoints xdata IntakeCalibrationPoints[10]; extern struct CalibrationPoints xdata DischargeCalibrationPoints[10];
only tells that somewhere among all your source files, there should exists variables IntakeCalibrationPoints and DischargeCalibrationPoints?
You need one module that contains them too. Where are the following lines?
struct CalibrationPoints xdata IntakeCalibrationPoints[10]; struct CalibrationPoints xdata DischargeCalibrationPoints[10];
PerF Westermark, you are a man of honour. After doing as you suggested, i got no error and no warning.
Infact, I am using keil first time, and new to firmware development. Please pardon me for any ridiculous query here! By the way, thankyou so much for your kind guidance!
Nothing specific to Keil or embedded development except for the xdata declaration. You have similar requirements for all C compilers, i.e. that you must understand the difference between definition and declaration.
The "extern" line just tells that there is a "3 Abbey Road" (somewhere).
The line without "extern" is the physical "3 Abbey Road".
In fact, similar requirements for all programming languages that allow you to construct a "program" from multiple "components"!
In some languages, you have to explicitly "export" things that are to be available to other "components"; eg, using a keyword like "Public" - this makes it clear that anything referenced as "Extern" has to have a corresponding "Public".
In 'C', there is no "Public" keyword: things at file scope are implicitly public - unless specifically made non-public with the static keyword.
Again, this is all standard textbook stuff - nothing specifically to do with embedded or Keil.
For some essential basic reference materials, see: blog.antronics.co.uk/.../12
For a specific aritcle on declaring and defining global variables and functions (including the difference between declarations and definitions), see: c-faq.com/.../decldef.html