Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
74
Добавлен:
14.04.2015
Размер:
2.03 Mб
Скачать

388

Chapter 11. Object-Hex Converter

 

 

Using OHx51

To invoke OHx51 from the command prompt, type the program name along with the name of the absolute object file. The command line format for the OHx51 utilities is:

OH51 abs_file HEXFILE (file)

OHX51 abs_file HEXFILE (file) H386 RANGE (start–end) OFFSET (offset)

OH251 abs_file HEXFILE (file) H386 RANGE (start–end) OFFSET (offset)

11

where

 

 

 

 

abs_file

is the name of the absolute object file that is generated by the

 

 

Lx51 linker/locator.

 

 

 

 

 

 

 

 

 

file

is the name of the Intel HEX file to generate. By default, the

 

 

 

HEX file name is the name of the

abs_file with the

 

 

 

extension .HEX.

 

 

 

 

H386

specifies Intel HEX-386 format for the Intel HEX file. This

 

 

 

format is automatically used, if the specified address range is

 

 

 

more than 64KBytes.

 

 

 

 

start-end

specifies the address range of the

abs_file that should be

 

 

 

converted to the Intel HEX file. The default range depends on

 

 

 

the device you are using and is listed in the following table:

 

 

 

 

 

 

 

 

 

OHx51 Converter (Architecture)

 

Address Range

 

 

 

OHX51 (Classic, and Extended 8051)

 

C:0x0000 - C:0xFFFF

 

 

 

Note: For code banking applications OHX51

 

 

 

 

the default setting converts the complete

 

 

 

 

 

content into an Intel HEX-386 format.

 

 

 

 

 

OHX51 (Philips 80C51MX)

 

0x800000 - 0x80FFFF

 

 

 

OH251 (Intel/Atmel WM 251)

 

0xFF0000 - 0xFFFFFF

 

 

offset

specifies an offset which is added to the address stored in

 

 

 

the abs_file.

 

 

 

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

389

 

 

OHx51 Command Line Examples

The following command generates an Intel HEX-386 file for a 251 device. The address range 0xFE0000 - 0xFFFFFF should be converted. The offset 0xFE0000 is subtracted to get an Intel HEX file that can be directly programmed into an EPROM that is mapped to the address space 0xFE0000 - 0xFFFFFF in the 251 address space.

OH251 MYPROG RANGE (0xFE0000-0xFFFFFF) OFFSET (-0xFE0000)

The next example generates an Intel HEX file for a banked application with a

 

classic 8051 device. Only the code bank 0 should be converted. The file format

11

used will be the standard Intel HEX format.

 

 

OHX51 PROG

RANGE (B:0-B:0xFFFF)

 

The command below generates an Intel HEX-386 file for a Philips 80C51MX

 

 

device. The OFFSET control is used to create an output file that can be directly

 

programmed into an EPROM.

 

 

 

 

OHX51 MYAPP

RANGE (0x800000-0x81FFFF) OFFSET (-0x800000)

 

 

With the next command line, the constants stored in the XDATA space are converted into an Intel HEX file.

OHX51 MYPROG RANGE (X:0-X:FFFF)

Creating HEX Files for Banked Applications

For the BL51 linker/locater the OC51 Banked Object File Converter described on page 392 is used to split banked object files into standard object files that contain a 64KB code bank. These files can be converted with OH51 into HEX files that store the content of a 64KB bank. These files are programmed separately into the corresponding physical address space of the EPROM.

For the extended LX51 linker/locater the OHX51 object hex converter generates in the default setting and Intel HEX-386 file that contains the common area and all the code banks. If code bank 0 does not exist in your application, OHX51 will skip this memory area.

Examples:

 

The figure below shows the HEX

The following figure shows the

390

Chapter 11. Object-Hex Converter

 

 

file content for the example “Banking With Four 64 KByte Banks” on page 299.

 

 

 

 

Code Bank #3

 

 

 

 

 

 

 

30000H

 

 

 

 

 

Code Bank #2

 

 

 

 

 

 

 

20000H

 

 

 

 

 

 

 

 

 

 

 

 

 

11

 

 

 

Code Bank #1

 

10000H

 

 

 

 

 

 

Code Bank #0

 

 

0

 

 

 

 

 

 

 

 

 

 

 

HEX file content for the example “Banking With Common Area” on page 303.

Code Bank #7

38000H

Code Bank #6

30000H

Code Bank #5

28000H

Code Bank #4

20000H

Code Bank #3

18000H

Code Bank #2

10000H

Code Bank #1

8000H

Common Area

0

OHx51 Error Messages

The following tables list error and warning messages of OHx51. Each message includes a brief description of the reason for the error or warning condition.

Error Message

***ERROR, INVALID RECORD-TYPE ENCOUNTERED

The absolute object file contains an invalid record type.

***FATAL, INCONSISTENT OBJECT FILE

The input file has an invalid format.

***ERROR, ARGUMENT TOO LONG

An argument in the command line is too long.

***ERROR, DELIMITER '(' AFTER PARAMETER EXPECTED

The command-line parameter must be followed by an argument enclosed in parentheses ().

*** ERROR, DELIMITER ')' AFTER PARAMETER EXPECTED

The command-line parameter must be followed by an argument enclosed in parentheses ().

*** ERROR, UNKNOWN CONTROL:

The specified command-line parameter is unrecognized.

***ERROR, RESPECIFIED CONTROL, IGNORED

The indicated command-line control was specified twice.

***ERROR, CAN’T OPEN FILE filename

The specified file cannot be open for read.

*** ERROR, CAN’T CREATE FILE filename

The specified file cannot be open for write.

Keil Software — A51/AX51/A251 Macro Assembler and Utilities

391

 

 

Error Message

*** I/O-ERROR ON FILE filename

A read/write error occurred during access of the specified file.

*** ERROR: PREMATURE END OF FILE ON filename

The input file does not end correctly. This is usually a result of a previous fatal error of an translator or linker/locater.

*** ERROR: MORE THAN 512 CLASSES ON filename

The input file contains more than 512 memory classes. This is the limit of OHx51.

*** ERROR, NON-NULL ARGUMENT EXPECTED

An argument is missing.

 

 

 

11

 

Warning Message

 

 

 

 

 

 

 

 

WARNING: <PUBDEF> HEX-FILE WILL BE INVALID

The absolute object file still contains public definitions. This warning usually indicates that the object file has not been processed by the Lx51 linker/locator. The hex file that is produced may be invalid.

WARNING: <EXTDEF> UNDEFINED EXTERNAL

The absolute object file still contains external definitions. This warning usually indicates that the object file has not been processed by the Lx51 linker/locator. The hex file that is produced may be invalid.

WARNING: <FIXUPP> HEX-FILE WILL BE INVALID

The absolute object file still contains fix-ups. This warning usually indicates that the object file has not been processed by the L251 linker/locator. The hex file that is produced may be invalid.

Соседние файлы в папке HLP