ARM Technical Support Knowledge Articles

WARNING 1 (UNRESOLVED EXTERNAL SYMBOL) USING SBITS

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


QUESTION

I want to use a bit of Port P1 for a chip select line. I have declared the chip select as follows:

sbit CS=P1^4;

In a second module I need to access this SFR, so I declare it as an extern:

extern bit CS;

When I link, I receive the following linker error:

Warning L1: Unresolved External Symbol
Symbol: CS
Module: second module name

Where have I made a mistake?

ANSWER

Unfortunately, you can't declare sbits as extern. You must declare the sbit in each C file (or create a header file for it). Just include the SBIT definition you already have in each file.

MORE INFORMATION

SEE ALSO

Article last edited on: 2007-03-27 10:46:54

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