Hi people, I'm using the old version of Keil compiler uVison 1. The linker is BL51 V3.70 I'm building my project from a batch file where I'm invoking the linker by the following command :
bl51 startup.obj, init.obj, rrex.obj, main.obj, uart.obj, glcd.obj, cmdp.obj, hi2c.obj, boot.obj TO TRX RS(256)
*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?C_INITSEG *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_HI2C_SENDI2C?HI2C *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_HI2C_RECEIVEI2C?HI2C LINK/LOCATE RUN COMPLETE. 3 WARNING(S), 0 ERROR(S)
bl51 startup.obj, init.obj, rrex.obj, main.obj, uart.obj, glcd.obj, cmdp.obj, hi2c.obj, boot.obj, hrtc.obj TO TRX RS(256)
*** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?C_INITSEG *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?HRTC_INIT?HRTC *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_HRTC_SETDATE?HRTC *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?HRTC_READDATE?HRTC LINK/LOCATE RUN COMPLETE. 4 WARNING(S), 0 ERROR(S)
Your problems may be caused since the startup code and init code are not the last 2 files in the obj file list. Refer to the following knowledgebase article. http://www.keil.com/support/docs/752.htm A question I have is, why are you forcing the init file to be included? This is done automatically by the linker when this file is required. Jon
You'll run into DOS command line length limitations with your linker line sooner or later. I.e. you'll have to use that @response file method in the long run --- might as well begin using it now.
What do you mean by response file ? I've tried the @commandfile where i've listed all the commands : startup.obj, init.obj, rrex.obj, main.obj, uart.obj, glcd.obj, cmdp.obj, hi2c.obj, boot.obj TO TRX RS(256) with same result
Jon, I've tried to include the STARTUP file at the end of the list. No difference. The INIT.OBJ file listed here isn't the init.a51 from Keil but my applicative init file. However, I've seen that the INIT.OBJ from Keil was deleted due to the same name used for my C applicative init routine. Shame on me ! So, I've renamed the INIT.A51 from Keil as A_INIT.A51 and I've included the A_INIT.OBJ file at the end of the command file when invoking the linker. It has solved some troubles I had.... But the problem is still the same. When adding one OBJ file more, the result is bad ! I think that the problem comes from the DOS command line limitation as mentionned Hans-Bernhard Broeker. The problem is that I don't know how to correct this.... Regards Stephane
If you think the problem is the DOS command-line limit, you can easily check it. Look in the linker map file and you will see the command line that was entered. If it doesn't match what was actually typed, then you know that's the problem. Otherwise, the linker creates a call tree that you can look thru to find out what actually does reference the HI2C segments. (once you add the HRTC.OBJ file). Jon
Well, it seems not to be DOS command limit. The M51 file shows all the included modules and it's correct. The call tree never refer to HI2C_SendI2C (for example) and not warning message !!! I really don't understand... Stephane
OK, I've founded my problem. The HI2C isn't displayed in the call tree of the M51 file but the HRTC module is calling it. As HTRC functions were not called, this explains why the linker doesn't refer to the HI2C uncalled segment and why the HI2C isn't refered in the call tree list. My applicative code is surely not crashing because of this. Stephane
Lesson learned: don't worry about warning messages you don't get (about your HI2C module, in this case). Not until you've resolved all the warnings you do get (those about HRTC), that is...