Hi After compiling my codes, I get the warning message: SECTION OUTSIDE CLASS AREA SECTION: CLASS: I assume that it means that the data are not with address range. Can any of you pleas kindly advise me to eliminate this problem? Thank you in advance AJ
In my codes, it carries RMS voltage and current calculations and the size of table is 150. So I reduced the length of table down to 100. Unfortunatley the performance of codes was poor. So I had to change it back again and I could not find another way of removing the warning message. Any suggestion? AJ
I don't see enough information to know why? Have you looked at the map file to see where your data is being located? What particular device are you using and what is your memory map? If you have this warning are you sure the code is really working correctly?
Since the warning code appears on the screen after compiling the codes. I tried to run the code and I have noticed that the reading became strange from the hyperterminal montior. for example i get regular number such as 400 and sometime a large or no number appears on the screen. So I know there is problem with my codes. So I reduced the size of table and I get no warning message. Unfortunately I didn't get the result that I realy want. Can you please tell me how to find and analyse the memory map in the keil environment? AJ
By the way Im using XC161 infineon chip AJ
What is the exact warning message you are getting? Which class is having the problem? NDATA...What??? Which device C16x, XC16x or ST10?
SECTION LOCATED OUTSIDE CLASS AREA SECTION: Math CLASS: NX0DATA (Can't remember what it says but summat like that)
#DEFINE RMS_TABLE_SIZE 150 long int *RMS(void){ long int *ptrV; long int RMSV; long int RMSCVT; int i; ptrV = &RMSV; RMSV = 0; for(i=0; i<RMS_TABLE_SIZE; i++){ RMSCVT = OutVoltage[i]; RMSV = (RMSCVT*RMSCVT) + RMSV; } RMSV = RMSV / RMS_TABLE_SIZE; RMSV = sqrt(RMSV); return ptrCoilV; }
Ok, I tried a little experiment with your example in which I added an additional array to fill up the entire data memory. Is the warning you get?
*** WARNING L5: SECTION LOCATED OUTSIDE CLASS AREA SECTION: ?ND0?MAIN CLASS: NDATA0
010008H OutVoltage VAR --- NDATA0 ?ND0?MAIN
00C248H OutVoltage VAR --- NDATA0 ?ND0?MAIN
That's it... I think that is my problem at this stage. As the size of table must be kept regardless, is there any suggestion to solve this problem. Im going to find another way to iron this problem asap I will come back to you later Btw thank you AJ
As the size of table must be kept regardless, is there any suggestion to solve this problem Is it a table of constants? If so, it should be calculated at compile time and be stored in ROM. If not, it's the usual trade-off between memory usage and performance. We might be able to suggest something if you explain what you are trying to achieve. Regards, - mike
I would add to Mike's comment... and if you wanted to use the ERAM on the XC16x1 for data (as an option). Have a look to the following link… http://www.keil.com/support/docs/2899.htm This talks about using the ERAM on XC16x devices for data. Follow the directions but with one exception, I would use far "FDATA, FDATA0" instead of near.
FDATA (0xE00000-0xE007FF), FDATA0 (0xE00000-0xE007FF),
int near_data; /* defaults to near memory */ int far far_data /* far data memory */
00C246H near_data VAR --- NDATA0 ?ND0?MAIN E00000H far_data VAR --- FDATA0 ?FD0?MAIN