Keil Logo

C51: Is STARTUP.A51 Required?


Information in this article applies to:

  • C51 Version 5.50a
  • C51 Version 6.00 Beta
  • C51 Version 6.00

QUESTION

I'm creating a project that is made up of C and assembly files. Do I need to use the STARTUP.A51 file that you provide, or can I use my own version?

ANSWER

We strongly urge you to use the STARTUP.A51 file that we provide as the basis for your startup routines. The Keil startup code performs the following operations:

  • Clears DATA and optionally PDATA and XDATA memory,
  • Sets up the reentrant stacks (if necessary)),
  • Initializes C Global Variables (see INIT.A51),
  • Sets the Stack Pointer (SP),
  • Jumps to your MAIN C function.

Your startup code must do all of these. If it doesn't, you may encounter run-time problems that are difficult to debug and diagnose.

Note that if you do not include some form of a startup file, Keil will automatically include a startup file from the Keil library.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


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.