CALLING BOOT LOADER FUNCTIONS FROM USER APPLICATION
Applies to: General Topics
Information in this article applies to:
- C51 Version 7.00
- C166 Version 4.00
- C251 Version 3.50
My application requires a BOOT loader that loads an application
into a FLASH device. I have created two different applications:
- A BOOT loader application.
- A FLASH application.
The FLASH application must call some of the functions in the BOOT
loader. Is there a clever way to do this?
Yes. You may use the linker (and the PUBLICSONLY directive)
to include the public symbols from the BOOT loader absolute object
module into the FLASH application. Then, the FLASH application may
access the functions and global variables in the BOOT loader
application. The linker will resolve the symbolic names but the BOOT
loader code will not be included in the FLASH application.
If you use the command line tools...
- Build and link the BOOT loader application.
- Build the FLASH application.
Link the FLASH application using the PUBLICSONLY
directive to include the linked BOOT loader absolute object
If you use the uVision IDE...
Add the linker output file of the BOOT loader application to
the FLASH application project. Since the linker output file
typically does not have a file extension uVision2 may prompt for
the type of file. Be sure to specify Object File.
Specify the PUBLICSONLY linker directive for the linker
output file of the BOOT loader object module. Right-click on the
BOOT loader in the project window to open the context menu and
select Options for File ... to open the Options -
Properties dialog. Check Link Publics Only and the
linker includes only the PUBLIC symbol information of the BOOT
loader object module. This provides full symbolic debugging in the
uVision2 simulator for the complete application (FLASH and
For 8051 applications, the BOOT loader and FLASH application must
both be linked with the LX51 Linker (available only in the PK51
Professional Developer's Kit). The PUBLICSONLY directive is
not available with the BL51 Linker.
Article last edited on: 2005-07-09 09:25:38
Rate this article
Disagree? Move your mouse over the bar and click