ARM Technical Support Knowledge Articles

GENERATING HEX FILES FOR BANKED APPLICATIONS

Applies to: LX51 Linker/Locator

Answer


Information in this article applies to:


QUESTION

I have a code banking application that was created using the BL51 Linker. Now, I am porting the program to use the new extended LX51 Linker. The HEX conversion what was done by OC51 and OH51 in the past generated a single HEX file for each code bank. How can we do that with the OHX51 HEX converter?

ANSWER

By default, OHX51 generates a single HEX file that contains all code banks. OHX51 can be used to generate a HEX file or files that will support virtually all hardware schemes. Following are several examples:

64K Code Bank with Common Area Repeated in Each Bank

A hardware example for this scheme is provided in the Ax51 User's Guide, Chapter 9. Linker/Locater, Bank Switching, Configuration Examples under Banking with Four 64KB Banks and Banking with XDATA Port.

For the OHX51 Options, you must specify the HEX-386 File Format (selected in uVision under Options - Output - HEX Format: HEX-386). This causes OHX51 to generate an Intel HEX-386 File which is configured as follows:

You may use this type of file with most device programmers.

32K Common Area Plus Multiple 32K Code Banks

A hardware example for this scheme is provided in the Ax51 User's Guide, Chapter 9. Linker/Locater, Bank Switching, Configuration Examples under Banking with Common Area.

For the OHX51 Options, you must specify the HEX-386 File Format and the MERGE32K directives (selected in uVision under Options - Output - HEX Format: HEX-386 and MERGE32K). This causes OHX51 to generate an Intel HEX-386 File which is configured as follows:

You may use this type of file with most device programmers.

Note that Code Bank 0 may not be used with the MERGE32K option because Bank 0 doesn't exist anymore. At this point any file assigned to Bank 0 would not have code in the generated hexfile.

For more information, refer to the Ax51 User's Guide, Chapter 11. Object-HEX Converter, Creating HEX Files for Banked Applications.

Individual HEX File for Each Code Bank

If you require a single HEX file for each code bank, you must create a batch program that runs OHX51 once for each code bank. The contents of the batch file will be similar to:

OHX51 my_program RANGE (B0:0 - B0:0xFFFF) HEXFILE (my_program.H00)
OHX51 my_program RANGE (B1:0 - B1:0xFFFF) HEXFILE (my_program.H01) OFFSET (-0x10000)
OHX51 my_program RANGE (B2:0 - B2:0xFFFF) HEXFILE (my_program.H02) OFFSET (-0x20000)

This effectively generates the same output files as the BL51 Linker using the OC51 and OH51 utilities.

MORE INFORMATION

Article last edited on: 2006-12-19 15:35:03

Rate this article

[Bad]
|
|
[Good]
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