Keil Logo

C166: SMALL PROGRAM DOES NOT FIT INTO MEMORY


Information in this article applies to:

  • C166 All Versions

QUESTION

I have just started with a small test program on a C164 device which looks like:

#include <reg164.h>
int bdata Result;
void main (void)  {
  ;
}

However, I cannot build this project. I get linker errors:

*** ERROR L114: SECTION DOES NOT FIT WITHIN SEGMENT BOUNDARY
    SECTION: ?BD0?BLINKY
    CLASS:   BDATA0

*** ERROR L107: CLASS ADDRESS RANGE OVERFLOW
    SECTION: ?BD0?BLINKY
    CLASS:   BDATA0

What is wrong and how can I fix this problem.

ANSWER

The linker messages indicate that you do not have space for placing the BDATA0 memory class and therefore the bdata variable cannot be allocated to memory. Details of the memory allocation can be found in the linker map file (*.M66).

The C164 design that you are working on is most likely just a single chip device without off-chip RAM. Therefore it might be necessary that you adjust the stack sizes in the STARTUP file (typically START167.A66). Therefore reduce the settings for System Stack (STKSZ) and User Stack (USTSZ) in this startup file.

You should also check, if the on-chip XRAM is enabled in both the STARTUP file (setting XPEN) and the µVision2 IDE (under Project — Options for Target — Target).

MORE INFORMATION

  • Getting Started User's Guide, Chapter 4, Writing Optimum Code

SEE ALSO

Last Reviewed: Tuesday, October 24, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.