BL51 warning


This is a problem of warning 16. i have tried the solution given in keil site
"
This warning occurs when functions which are not called are contained in a program (e.g. for test purposes). The function specified is excluded from the overlay process in this case. Often this warning is accompanied by
ERROR 107: ADDRESS SPACE OVERFLOW
If you fix the uncalled warning the Error 107 is often cleared as well.
There are two ways to solve this problem.
1. Call the uncalled function from somewhere in your program.
2. Remove or #if out the function that is not called. You can do that using #if 0 in front of and #endif after the uncalled function. For example:
#if 0
void uncalled_function (void)
{ }
#endif"

even after each one of above the problem persists.
Would you please throw some light.

The errors are pasted as below.
*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?RI2C_SLAVEADDRESSRECEIVED?RI2C_DCN

*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?RI2C_SLAVESEND?RI2C_DCN

*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?RI2C_SLAVERECEIVE?RI2C_DCN

*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_MOVXD0?CLIB

*** ERROR 107: ADDRESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: ?DT?TEXTVARS
LENGTH: 0001H

*** ERROR 118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: TXTREQ
MODULE: ..\APPLIC\LIB\T90PTR1.LIB (TXREVEAL)
ADDRESS: A13CH

Parents
  • Contrary to any error message, the problem is that these unused functions are NOT not remove from the overlay process. (The prefered method of handling unused functions is to remove them. I do NOT have a clue as to why Kiel does it this way.)

    These unused function are placed in overlay branches of their own. Thus their varaiables are not overlayed with the rest of your program. This wastes a lot of data space. Usually enough to break your program.

    Here is a different techinque. Not only is it simpler, but it insures 100% overlaying of unused data space. Put only unused functions in the list, or that will also waste data space.

    #include "RI2C.h"  //guessing the file name
    
    char unusedFns( void )
    {
      code char unusedFnsArray[] =
      {
        RI2C_SLAVEADDRESSRECEIVED,
        RI2C_SLAVESEND,
        RI2C_SLAVERECEIVE,
        _MOVXD0
      };
    
      return unusedFnsArray[0];
    }
    
    void mainProgram( void )
    {
      //the code that used to be in main
    }
    
    void main()  //make no changes to this function
    {
      unusedFns();
      mainProgram();
    }
    

Reply
  • Contrary to any error message, the problem is that these unused functions are NOT not remove from the overlay process. (The prefered method of handling unused functions is to remove them. I do NOT have a clue as to why Kiel does it this way.)

    These unused function are placed in overlay branches of their own. Thus their varaiables are not overlayed with the rest of your program. This wastes a lot of data space. Usually enough to break your program.

    Here is a different techinque. Not only is it simpler, but it insures 100% overlaying of unused data space. Put only unused functions in the list, or that will also waste data space.

    #include "RI2C.h"  //guessing the file name
    
    char unusedFns( void )
    {
      code char unusedFnsArray[] =
      {
        RI2C_SLAVEADDRESSRECEIVED,
        RI2C_SLAVESEND,
        RI2C_SLAVERECEIVE,
        _MOVXD0
      };
    
      return unusedFnsArray[0];
    }
    
    void mainProgram( void )
    {
      //the code that used to be in main
    }
    
    void main()  //make no changes to this function
    {
      unusedFns();
      mainProgram();
    }
    

Children
More questions in this forum