I am new to embedded programming in C and CodeWarrior and I was wondering if any one could help me with my problem. It seems when I go to build my project I get some kind of linker error like this:
**** Build of configuration FLASH for project test ****
"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j12 all
'Building target: test.elf'
'Executing target #9 test.elf'
'Invoking: ColdFire Linker'
"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "test.elf" @@"test.args"
C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error
>Undefined : "tFlag"
>Referenced from "TI1_OnInterrupt" in
mingw32-make: *** [test.elf] Error 1
C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error
>Link failed.
I am using a DEMOEM board with the MCF51EM family microcontroller. Any advice would be greatly appreciated.
Thank you,
Tyler
You should inspect the function TI1_OnInterrupt.
This function uses a variable tFlag, search this variable, it is declared somewhere with something like
extern int tFlag;
But it seems that the definition is missing.
You need to add
ìnt tFlag;
From your posted code:
The
tFlag
variable is visble only in main().You should move it outside of the function