ARM Technical Support Knowledge Articles

CREATE A PATCH VECTOR TABLE

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

I need to create a ROM mask that provides some functions. However, it should be possible to overwrite the functions for providing software patches. Therefore, a patch table is located in a Flash ROM that may be overwritten by later software downloads, whereas the main part of the software is located in mask ROM and cannot be modified later.

Currently I have defined this patch table as shown below:

EXTRN  CODE (Func0, Func1)
PUBLIC vFunc0, vFunc1

?PR?PPATCHTABLE SEGMENT CODE
RSEG ?PR?PPATCHTABLE
vFunc0:  LJMP vFunc0
vFunc1:  LJMP vFunc1

However, during linkage I get a problem with the data overlaying that is implemented in the 8051 linker. It reports *** WARNING L13: RECURSIVE CALL TO FUNCTION, even when there are no program recursions. How can I prevent the linker from reporting such warnings?

ANSWER

The overlay analysis of the linker is based on segment names. However, the Extended AX51 Macro Assembler (which is part of the PK51 Professional Developer's Kit) also supports a procedure concept. First, select the Extended AX51 Macro Assembler under Options for Target - Device.

Then modify your patch table as shown below:

?PR?PPATCHTABLE SEGMENT CODE
RSEG ?PR?PPATCHTABLE
vFunc0   PROC
         LJMP vFunc0
         ENDP

vFunc1   PROC
         LJMP vFunc1
         ENDP

Due to the PROC / ENDP statements, the linker can isolate the individual functions and generate a proper call tree during overlay analysis.

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-18 18:57:39

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