Keil Logo

C251: Create Hex Files for Code Banking Applications


Information in this article applies to:

  • C251 Version 3.60

QUESTION

I am using the Keil C251 toolchain to create a banked application. However, the HEX file created does not contain the individual banks, but instead a complete image.

How can I create individual HEX files for each code bank?

Also, I need to know the hardware configuration that allows me to use a common area and up to four code banks. Can you provide a circuit diagram?

ANSWER

The first code bank is in the HEX file at address 80:0000 the 2nd code bank on address 81:0000 and so one. This is clearly shown in the linker MAP file under MEMORY MAP OF MODULE

You may generate individual HEX files using OH251 in a batch file, as shown below.

oh251 example1 hexfile (example.h00) range (0x800000-0x80FFFF)
oh251 example1 hexfile (example.h01) range (0x810000-0x81FFFF)
oh251 example1 hexfile (example.h02) range (0x820000-0x82FFFF)

You may run this batch file after the make command. That way, the hex files get created automatically after each build command.

Schematics for code banking hardware is provided in the LX51 User's Guide. These examples are for a generic 8051, but can be easily adapted to a 251 hardware. By using the A16 and A17 address lines as enabled (when both lines are high, the code banking is enabled in 0xFF:0000).

MORE INFORMATION

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.