ARM Technical Support Knowledge Articles


Applies to: C51 C Compiler


Information in this article applies to:


My 8051 target hardware does not have continuous XDATA memory. Is there a way I can declare the XDATA that is available for variables so that the compiler and linker automatically locate my XDATA variables automatically?


Yes. In C51 V6.01 and later, you may specify XDATA ranges to the BL51 linker. You may specify a range for each valid XDATA area and let the BL51 linker locate your XDATA segments automatically.

For example, suppose you have XDATA ranges from 0x0000 to 0x1FFF and from 0x4000 to 0x4FFF. And, that you have segments (?XD?SEG1, ?XD?SEG2, and ?XD?SEG3) which should be located in the XDATA range from 0x0000-0x1FFF and the following segments (?XD?SEG4, ?XD?SEG5, and ?XD?SEG6) which should be located in the XDATA range from 0x4000 to 0x4FFF.

On the Command Line

Compile as normal. Use the following linker command line:

BL51 ... XDATA (0x0000-0x1FFF,0x4000-0x4FFF,
         ?XD?SEG1 (0x0000), ?XD?SEG2, ?XD?SEG3, ?XD?SEG4 (0x4000), ?XD?SEG5, ?XD?SEG6)

Since all unspecified XDATA segments are located after the last specified XDATA segment, you may avoid listing ALL XDATA segments in the linker command line.

In uVision2

  1. Specify the XDATA ranges on the Target Off-chip XDATA Memory dialog.
  2. Add the following to XDATA Segments on the BL51 Locate dialog: ?xd?seg1 (0x0000), ?xd?seg2, ?xd?seg3, ?xd?seg4 (0x4000), ?xd?seg5, ?xd?seg6


Article last edited on: 2005-07-09 11:02:46

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential