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.
I have quite a lengthy (but otherwise functional) linker command file I use to position all my segments to my liking. What I want to do, however, is force the output name of the ABS and the HEX file. The Utilities book shows the "TO Sample.ABS" as a way to do this, but I cannot find a place to put such a line in the linker command file where it doesn't cause a linker error. Example of my .lin file (clipped)
CODE (2000H, seg1( 100h), seg2) && STACK( ?Stack ( 0B0H ) ) && RAMSIZE(256) && NOOVERLAY NOLINES PAGELENGTH(10000)
which is just what it says on the tin:
BL51 [inputlist] [TO outputfile] [controls]
I have no object modules in my .lin file. The first and last lines are similar to the example (only the middle is clipped):
TO XYZ.ABS && // with and without a comma CODE (2000H, seg1( 100h), seg2) && STACK( ?Stack ( 0B0H ) ) && RAMSIZE(256) && NOOVERLAY NOLINES PAGELENGTH(10000)
CODE (2000H, seg1( 100h), seg2) && STACK( ?Stack ( 0B0H ) ) && RAMSIZE(256) && NOOVERLAY NOLINES PAGELENGTH(10000) && TO XYZ.ABS
If you are running this from uVision2, click on Options - Output Tab and enter the name in the [Name of Executable] input line at the top. This will create the ABS OMF file using that filename. In uVision2, the IDE already specifies the TO directive. Also, the options you specify may be entered in the IDE and then you wouldn't have to create a linker file. Jon
My version of uVision must be too old because I have no Options/Output tab. With respect to not using a command file, that's not really an option as I am playing some location tricks to accomodate a bootstrap/flash oriented system where upload code must be able to reference functions within the boot segments.
Ahhhh, OK. You must be using the uVision Version 1.xx. Jon
Yeah, I know...cheapskate. Right now I don't have an upgrade budgeted. What I am wondering, however: Is the "TO" command causing an error because I am specifying no .OBJ files in my command file? I have a project built using uVision (V1.31) where I add component files (both C and A51 modules), but then I specify a command file in the BL51 project options. Thus, the uVision build command gets its list of OBJ files from the project and then tacks on my command file. In the BL51 Options/Files, I see where it constructs a command line in the "Command Line Option String" readout but it won't let me add anything to this string. I guess I could add my OBJs to my command file and run the whole thing manually. Perhaps this way I would then be able to add the "TO" command...unless, of course, you want to give me a free upgrade :)
uVision1 automatically specifies the TO command. If you specify it ALSO, the liker doesn't know which one to use and so it probably generates something lik "respecified directive" or something like that. If that's the case, you can create a complete linker response file and tell uVision not even to generate the list of OBJ files. However, whenever you change the project, you'll have to update the linker response file. Jon
That's what I just did and it works fine. I added my OBJs to the top of my command file, then created a batch file to invoke BL51 as such:
BL51 @mycmd.lin TO myprog.abs OH51 myprog.abs HEXFILE(myprog.hex)