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
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