Keil™, An ARM® Company

Technical Support

LX51: FINDING THE END OF THE BINARY


Information in this article applies to:

  • C51 All Versions

SYMPTOM

I need to locate the end of my binary image, to allow me to run a checksum on my program.

CAUSE

Set a given segment as the last, in the link order.

RESOLUTION

The LX51 linker has a feature that allows a given segment to be explicitly placed at the end of a binary image. To use this feature:

  1. Create a .C file (for example, foo.C) with a single line, as follows;
    unsigned char code EOM;
    
  2. Add foo.C to your project.
  3. Under the Project - Options for Target... - LX51 Locate tab, add the following to the User Segments box:
    ?co?*, ?pr?*, ?co?foo(last)
    
  4. EOM is now the last byte in the program binary image.

SEE ALSO

  • Refer to SEGMENTS in the LX51 User's Guide.

FORUM THREADS

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

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure