Keil Logo

C51: RESERVE MEMORY AT ABSOLUTE BANK ADDRESSES


Information in this article applies to:

  • C51 All Versions
  • BL51 All Versions
  • LX51 All Versions

QUESTION

I am using the C51 Compiler and µVision with a code banking project. I have a 88KB CODE memory in the chip. The lower 32KB is assigned to the common area, and the rest is for the code banked area. I have 2 banks: one 32 kb and the other is 24 kb. Is there a way to tell compiler/linker that not all the banks are of the same size?

I need the compiler linker to enforce the size issue in order to know any violations in size.

ANSWER

Yes, you can block the memory usage in the linker as described below:

When using the LX51 Linker/Locater, just enter under Options - LX51 Locate - Reserve: B1:0xE000-B1:0xFFFF. This blocks the memory area 0xE000 - 0xFFFF from being used by other variables.

When using the BL51 Linker/Locater, the solution is a bit more complex. You can reserve the memory area 0xE000 - 0xFFFF in bank 1 with the following method:

  • Add a source module called B1_RESERVE.C with the following content:
    code unsigned char dummy[0x2000];
    
  • Enter under Options - BL51 - Misc - Misc: BANK1 (?CO?b1_reserve (0xE000)). This locates dummy to address 0xE000 in bank 1.
  • Enter under Options - BL51 - Misc - Overlay: * ! ?CO?b1_reserve. This avoids the linker Warning L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS.

MORE INFORMATION

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

SEE ALSO

Last Reviewed: Thursday, August 17, 2006


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.