Keil Logo

GENERAL: COMMUNICATION BETWEEN BOOTLOADER AND APPLICATION


Information in this article applies to:

  • C51 All Versions
  • C166 All Versions
  • C251 All Versions

SYMPTOM

How can I pass information from my bootloader to my main program?

CAUSE

Since a bootloader and an application program have access to the same data memory, passing values from one to the other is quite simple.

RESOLUTION

Define an identical, explicitly placed, variable in both projects. Such as:

int xdata bootStatus _at_ 0x0100;

If you write to bootStatus in the bootloader, you can read that data in the main program.

Beware however, if the main program initializes the area of memory in which the data variable is located, you will not be able to retreive the information. To avoid this possibility, disable data initialization in your main program, and enable it in the bootloader only.

See Also

  1. GENERAL: CALLING BOOT LOADER FUNCTIONS FROM USER APPLICATION

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.