Keil Logo

GENERAL: CREATING A HEX FILE WITH CONSTANTS ONLY

QUESTION

I am trying to burn an eprom with only constants, no code. How can I get the compiler not to add the startup code to the beginning of my hex file?

ANSWER

First, make sure there is no main function in your code. If there is, the compiler ALWAYS includes the startup code.

Then add #pragma SRC to the top of your C file. This forces the compiler to generate assembler code instead of an object file. Assemble and link the resulting .SRC file and the startup code will not be included.

Last Reviewed: Monday, May 10, 2004


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.