This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Warning message

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

Parents
  • 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;
    }
    
    

    I have used the similar code above to calculate other processes for voltage and current.

    AJ

Reply
  • 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;
    }
    
    

    I have used the similar code above to calculate other processes for voltage and current.

    AJ

Children
  • 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
    
    When looking at the map file I see that my near data was moved to 0x10000 which does not exist in the defined memory map. There is no on-chip memory at 0x10000. Please have a look to the XC161 user's manual concerning the memory map to make sure you don't have any code or data declared outside of what is available.
          010008H     OutVoltage                       VAR   ---  NDATA0  ?ND0?MAIN
    
    So this tells me that you are declaring more memory than what actually exists on-chip. You should expect some like this in the map file.
          00C248H     OutVoltage                       VAR   ---  NDATA0  ?ND0?MAIN
    
    This is not to say that this would be the same variable as I don't have your full code but perhaps this can give you a clue to look for. This assumes that this is the problem you are having.

    -Chris

  • 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),
    Now, if you are using a small memory model then the default data is near and will have fast access (single cycle) and then use the far keyword on the variables that are accessed infrequently.

      int near_data; /* defaults to near memory */
      int far far_data /* far data memory */
    
    From the map file
    00C246H     near_data  VAR   ---  NDATA0  ?ND0?MAIN
    E00000H     far_data     VAR   ---  FDATA0  ?FD0?MAIN
    

    Perhaps you are a very experienced embedded programmer but for those who are not. It is very important to understand the architecture of the device you are using and willfully choose in which memory area to locate your variables. When a chip manufacturer includes different memory areas on a device there are generally performance implications. Why, because this usually translates into the performance/cost ratios to construct and sell such devices.

    -Chris