Keil Logo

GENERAL: CALLING BOOT LOADER FUNCTIONS FROM USER APPLICATION


Information in this article applies to:

  • C51 Version 7.00
  • C166 Version 4.00
  • C251 Version 3.50

QUESTION

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?

ANSWER

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...

  1. Build and link the BOOT loader application.
  2. Build the FLASH application.
  3. Link the FLASH application using the PUBLICSONLY directive to include the linked BOOT loader absolute object module.

If you use the µVision IDE...

  1. 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 µVision2 may prompt for the type of file. Be sure to specify Object File.
  2. 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 µVision2 simulator for the complete application (FLASH and BOOT).

Note
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.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, January 11, 2017


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.