We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all, i have DECT handset based on 8051 controller.. and i also have an application software running on it.
I am planning to run this software in debug mode in Keil IDE itself, so that i can run some keypad simulators interfaced through AGSI driver interface.
SO i commented a funtion call which internally declares some local variables. then the linker gives me this error.. if i uncomment the function call ... every thing works fine...
i am using SMALL memory model...
can anyone please suggest me the reason for it.
error is
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 000050H
thanks, supreet
Maybe "some local variables" are more than the data memory (where space for variables will be allocated when using the small memory model if no other memory area is specified) of your MCU can hold?
I'll bet that wasn't the only message, was it...?
What other errors and/or warnings did you get?
<bug>identifier=(i am using SMALL memory model...)<endbug>
i had this bug before .you can fix it with the the large model.
Thanks for the reply,
i will give an example of my problem,
Main() { dummy_func1(); //dummy_func2(); dummy_func3(); }
dummy_func2() { unsigned char a; unsigned int b; /* some code here */ }
So if i do something like this then the linker error comes.. if i remove the commenting of function call dummy_func2(), then everything works fine..
The question i am asking here is, if i am not calling the function dummy_func2() then i am actually not declaring two variables , so it actually has to reduce the DATA memory occupied...
But exactly opposite thing happens, when i call the function and two variables are decalred the Overflow error doesnt come...
Thanks, Supreet
PS: MY application is not as simple, i just gave an example of the problem :)
Hmm yes i have some other WARNINGS like ...
*** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: INIT_HARDWARE_TIMER/TIMER
Because i have commented the calling of these functions...
and BTW my application is 220KB, so i have used code banking each of 32 kb including common bank...
thanks for the reply,
yes i had tried using it, then it gives me following error
*** ERROR L121: IMPROPER FIXUP MODULE: .\u-PT\PMM.obj (PMM) SEGMENT: ?PR?DECODE_MM?PMM OFFSET: 000388H
i thought then i have to do some more configuration, hence i switched back to SMALL model...
The problem is i have this pretty big application .. its an complete DECT handset application including protocol stacks and drivers...
i thought of running this in debug mode, so that i can use some simulators for development purpose... this will avoid me from loading the application to hardware every time i change a small menu display...
thanks, Supreet
It's because of the linker overlay process.
Because the function is not called via the usual exectution path, the linker assumes that it might be called via a function pointer or an ISR. Therefore it must be considered to be in a separate call tree and local variables are not overlayed with the ones they were previously overlayed with.
Sorry - My explanation probably sounds confusing, but it is detailed pretty well somewhere in the Keil documentation.
"i had this bug before .you can fix it with the the large model."
Bug? Why refer to it as a bug? It's intentional, documented behaviour!
And as for the fix - Well, I hope Eric Malund doesn't notice your comment :o
The above shows why warnings should be treated as errors unless you are 100% sure that you know what the warning means and are 100% sure that you know if the warning represents a harmless condition.
If you had used the search box here, you could have found a number of threads discussing the memory consumption created by uncalled functions.
yup you are right. It makes sence... actually the functions i am commenting have to called in the final application that goes into the hardware.
i want the application to run in Keil so that i can use some simulators which in turn help me time consuming process of loading the app to the hardware every time a make small change. But when i run in Keil some of functions blocks execution because they are expecting some responses from hardware, i just want to comment these functions so that it doesnt block anywhere..
any idea how to remove this linker error msg i get..
Most people use either conditional compilation or a special source file with suitably augmented stub functions.
Let the stub functions send output on a serial port or similar, and possibly extract input from data structures or a serial port. By faking I/O you can run large parts of your logic in the simulator or regression-test large parts of the code without building expensive hardware jigs that creates stimuli.
no no no Arthur - Erik will kiss and hug him for using the small memory model :-)
hmm yup that will be my last option :)
actually i am developing simulator in VC++ and using the AGSI interface facility provided by Keil uVision IDE to hook it up with my application...
any how this process is becoming complicated so may be i start using stubs iself... thanks for the comments :)
As already noted, it is not a bug.
Using the Large model does not "fix" it - if you only had limited XDATA space, you would get a similar error with the Large model!
... when i have temporarily unused functions is this
// uncalled function error killer ralph = 0; if Ralph { foo(); /temporarily unused function }
Erik