Keil Logo

LX51: Locating Program or Variables to Special Areas


Information in this article applies to:

  • C51 Version 7

QUESTION

I am writing an IAP loader and would like to locate it in the first 1024 Bytes of my CODE memory.

How can I ensure this?

I have tried to use wildcards, but this did not work out, since it collides with interrupt vectors.

ANSWER

The best approach is to locate the program code with a USER CLASS. User classes are an extension of the LX51 Linker/Locater (which is available in the PK51 Professional Developer's Kit).

For example, you can write the following pragma within the C source files that contain the IAP loader program code:

#pragma userclass (code = IAP)    // generates CODE_IAP class

This userclass directive places the program code of the module to the memory class CODE_IAP. Now you can separately locate this memory class when you enter it in µVision under Project - Options for Target - LX51 Locate - User Class. To locate the IAP code to the first 1KB of your program section enter here.

CODE_IAP (C:0 - C:0x3FF)

Note, you have to select the Use Extended Linker LX51 under Project - Options for Target - LX51 Locate - User Class.

MORE INFORMATION

  • Refer to USERCLASS in the Cx51 User's Guide.
  • Refer to CLASSES in the LX51 User's Guide.

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.