Coldfire: How to use symbols in lcf file?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Coldfire: How to use symbols in lcf file?

1,164 Views
MrWrong
Contributor I
Hi all,

Since I am a newbie to CW, please excuse me for such a elementary question.

I'm using CW 6.3 with M5211DEMO board. In the M5211DEMO_SRAM.lcf file, I declare a buffer as:
___BUF_SIZE = 0x400;
___BUF_START = ___HEAP_END;
___BUF_END = ___BUF_START + ___BUF_SIZE;

I want to use these symbols, so in a header file (test.h), I re-define them as:
#define BUF_START ___BUF_START
#define BUF_SIZE ___BUF_SIZE

In the main program, I include "test.h" and use BUF_START and BUF_SIZE in main(). However, when I compile, I got the error message saying that ___BUF_START and ___BUF_SIZE are undefined identifiers.

Can anyone let me know what I am missing here?

Thank you very much.

Message Edited by CrasyCat on 2007-04-13 02:18 PM

Labels (1)
0 Kudos
1 Reply

266 Views
CompilerGuru
NXP Employee
NXP Employee
You have to have a declaration of any identifier in C.
Add something like this to your header file:
extern char ___BUF_START[];
extern char ___BUF_SIZE[];

Dont add a definition as the lcf is used to define those symbols.
0 Kudos