ARM Technical Support Knowledge Articles

ERROR 45 (UNDEFINED SYMBOL (PASS-2))

Applies to: A51 Macro Assembler

Answer


Information in this article applies to:


SYMPTOMS

I am trying to assemble the RTX51 Tiny configuration file CONF_TNY.A51. I open the file in uVision and click on the Compile button and I receive the following error message:

Error 45: Undefined symbol (pass-2)

for the very last line of the file which is:

?RTX_STACKERROR:  STACK_ERROR

What is wrong with that line? I haven't modified the file in any way.

CAUSE

Nothing is wrong with the last line. What has happened is that the assembler has gone through the entire file looking for the definition of a symbol. It has reached the last line and still not found the definition. The assembler then generates the error and it appears that the cause is the last line because that is where the assembler stopped.

RESOLUTION

To find out which symbol or symbols caused the problem you need to look at the symbol table in the generated .LST listing file:

SYMBOL TABLE LISTING
------ ----- -------

N A M E             T Y P E  V A L U E   ATTRIBUTES

?RTX51_TINY_CONFIG  N NUMB   -----
?RTX?CODE. . . . .  C SEG    0004H       REL=UNIT
?RTX_CLOCK . . . .  N NUMB   EC78H   A
?RTX_CURRENTTASK .  D ADDR   000DH   A
?RTX_FREESTACK . .  N NUMB   0014H   A
?RTX_RAMTOP. . . .  N NUMB   00FFH   A
?RTX_REGISTERBANK.  N NUMB   0008H   A
?RTX_ROBINTIME . .  D ADDR   000CH   A
?RTX_SAVEACC . . .  D ADDR   000AH   A
?RTX_SAVEPSW . . .  D ADDR   000BH   A
?RTX_STACKERROR. .  C ADDR   0000H   R   SEG=?RTX?CODE
?RTX_TIMESHARING .  N NUMB   0000H   A
EA . . . . . . . .    ----   -----
FREE_STACK . . . .  N NUMB   0014H   A
INT_CLOCK. . . . .  N NUMB   1388H   A
INT_REGBANK. . . .  N NUMB   0001H   A
RAMTOP . . . . . .  N NUMB   00FFH   A
TIMESHARING. . . .  N NUMB   0000H   A

Here you can see that all the symbols except for EA have been defined.

You would then need to go through and figure out why the symbol wasn't defined. The definition may have been left out or mistyped.

In this case EA is not defined in the CONF_TNY.A51 file and isn't supposed to be.

Choose A51 Assembler from the Options menu and click on the Object tab.

There is an option to Define 8051 SFRs. Check this option and rebuild the CONF_TNY.A51 file. RTX51 Tiny requires that the 8051 SFRs are defined by the assembler. That's why this directive is required.

EA will now be defined as can be seen in the new symbol table:

SYMBOL TABLE LISTING
------ ----- -------

N A M E             T Y P E  V A L U E   ATTRIBUTES

?RTX51_TINY_CONFIG  N NUMB   -----
?RTX?CODE. . . . .  C SEG    0004H       REL=UNIT
?RTX_CLOCK . . . .  N NUMB   EC78H   A
?RTX_CURRENTTASK .  D ADDR   000DH   A
?RTX_FREESTACK . .  N NUMB   0014H   A
?RTX_RAMTOP. . . .  N NUMB   00FFH   A
?RTX_REGISTERBANK.  N NUMB   0008H   A
?RTX_ROBINTIME . .  D ADDR   000CH   A
?RTX_SAVEACC . . .  D ADDR   000AH   A
?RTX_SAVEPSW . . .  D ADDR   000BH   A
?RTX_STACKERROR. .  C ADDR   0000H   R   SEG=?RTX?CODE
?RTX_TIMESHARING .  N NUMB   0000H   A
EA . . . . . . . .  B ADDR   00A8H.7 A
FREE_STACK . . . .  N NUMB   0014H   A
INT_CLOCK. . . . .  N NUMB   1388H   A
INT_REGBANK. . . .  N NUMB   0001H   A
RAMTOP . . . . . .  N NUMB   00FFH   A
TIMESHARING. . . .  N NUMB   0000H   A

MORE INFORMATION

Article last edited on: 2005-07-15 12:53:50

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