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

Compile code using ON CHIP memory in 2051

Hello all,
I am learn myself programming in C for MCUs. Especially for x51.
At start i choose 2051.
And i have problem.
When i wrote a simple program and check USE ONCHIP MEMORY in project settings i get this errors while compiling
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MAIN?ZK1 LENGTH: 002FH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?PR?MAIN?ZK1 LENGTH: 002FH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?C_C51STARTUP LENGTH: 000CH
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: CODE SEGMENT: ?C_C51STARTUP LENGTH: 000CH
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT SYMBOL: MAIN SEGMENT: ?PR?MAIN?ZK1
*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT SEGMENT: ?PR?MAIN?ZK1 MODULE: zk1.obj (ZK1)
*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT SEGMENT: ?C_C51STARTUP MODULE: D:\8051\KEIL-C\C51\LIB\C51S.LIB (?C_STARTUP)
*** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL SYMBOL: ?C_START MODULE: D:\8051\KEIL-C\C51\LIB\C51S.LIB (?C_STARTUP) ADDRESS: 000AH

Here is the code of the program

#include <AT892051.h>
void main(){ short i=0; while(1) { P1=255; while(i<255) { i++; } P1=0; i=0; while(i<255) { i++; } }
}

What I do wrong?

0