Keil Logo

C51: Unresolved External with Far Memory Type


Information in this article applies to:

  • C51 Version 7

QUESTION

I am using the far memory type. Everything compiles fine, but during linkage, I get the following error messages:

*** ERROR L127: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  ?C?CLDXPTR
    MODULE:  C:\KEIL\C51\LIB\C51BL.LIB (?C?CLDPTR)

*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  ?C?CLDXPTR
    MODULE:  C:\KEIL\C51\LIB\C51BL.LIB (?C?CLDPTR)

What is the reason for these error messages?

ANSWER

You need to configure the bank switching module for the far memory type. Once this is done, the following memory access functions are available for accessing far memory:

?C?CLDXPTR, ?C?CSTXPTR  ; load/store BYTE (char)  in extended memory
?C?ILDXPTR, ?C?ISTXPTR  ; load/store WORD (int)   in extended memory
?C?PLDXPTR, ?C?PSTXPTR  ; load/store 3-BYTE PTR   in extended memory
?C?LLDXPTR, ?C?LSTXPTR  ; load/store DWORD (long) in extended memory

There are two modules that contain the template code for these functions. Both modules are found in source code in the folder Keil\C51\LIB.

  • L51_BANK.A51: banking configuration file for classic 8051 architecture. The configuration of this module is explained in detail in the Ax51 User's Guide, Chapter 9, Bank Switching, Bank Switching Configuration. For far memory type support (variable banking), you need to set ?B_VARBANKING to 1.
  • XBANKING.A51: banking configuration file for devices with data banking extension hardware. This might also be useful for designs that use an FPGA banking extension. Basically, the file contains the source code of the memory access functions.

Detailed configuration examples for various hardware platforms can be found in the folder Keil\C51\EXAMPLES\FarMemory.

MORE INFORMATION

  • Ax51 User's Guide, Chapter 9: Bank Switching

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.