Hello everybody!
I am using the Easy Kit for the XC164CS-32F microcontroller for a CAN-Bus application. On the enclosed CD for the development kit I found a demo-code for CAN applications, a so called LLD(Low Level Driver) software for the TwinCAN module, developed by Infineon (I found that one nowhere on the inet). The code looked pretty good (encapsulation, API, and so on) and the header-description showed my that it was compiled for my controller. Although some files where compiled for TC1775B(I never found that one on Infineon's website). So, no suprise the project didn't compile as expected. After several changes no more syntax errors occured and the compilation itself worked. So when hitting build target the C166 compiler showed no errors. The Linker L166 complains about a missing object file (*** FATAL ERROR L210: I/O ERROR ON INPUT FILE: EXCEPTION 0021H) and therefore is not able to create the project. So a quick look into my project folder shows that the missing object file (called CAN_API.obj) is really not there! So there is still a compiler problem. The CAN implementation has three C-files (CAN_interrupts.c/CAN_interface.c/CAN_API.c) and several header-files. The first two files, when translated seperately result in a object-file but the third one does not. CAN_API.h contains basically all the prototypes and CAN_API.c has all the definitions of these functions.
So to cut a long story short: Why is there no object-file generated?
Any suggestions?
Thanks in advance, tom
//---------------------------------------------- IDE-Version: µVision3 V3.30a
Tool Version Numbers: Toolchain Path: C:\Keil\C166\BIN\ EC++ Compiler: EC166.Exe V1.09a C Compiler: C166.Exe V6.04 Assembler: A166.Exe V5.20 Linker/Locator: L166.Exe V5.21 Librarian: LIB166.Exe V4.26 Hex Converter: OH166.Exe V4.7a CPU DLL: S166.DLL V2.50 Dialog DLL: D167.DLL V2.45b Target DLL: MONITOR\MON166.DLL V2.41 Dialog DLL: T167.DLL V2.46
That you have the C file in your project directory isn't enough.
Is it part of the project?
Is the project configured to build this source file for the currently selected target?
Absolutely!
All files are added to the project correctly (all files in the same project folder). I also tried forced each C-file to be included in the target build (right mouse button on corresponding C-file -> Options for File '...' ) by setting the check on 'Include in Target Build' manually.
By checking each Listing-file of CAN_interrupts and CAN_interface and comparing them to the Listing-file of the problematic C-file CAN_API.c I see that in CAN_API.lst all the module informations are missing. Compiler just says 'C166 COMPILATION COMPLETE. 32 WARNING(S), 0 ERROR(S)'. I am quite sure that none of these warnings are relevant.
If I check the option Symbols for the Listing-files, all the information is shown in CAN_interrupts.lst and CAN_interface.lst but nothing in CAN_API.lst
- I don't get it!
did you try to compile it from the command line?
have you opened your .uv2 file with an editor and made sure that the file in question was added to it?
May be totally off the path here, but have you got a McAfee virus checker installed?
Why do I ask this? - Because, a while ago I found that I was building a project with no errors being reported during compilation, but then getting a failure during linking with missing obj files.
The compiler was actually seeing errors in the code but they were not being reported; and no obj file was generated.
Disabling the virus checker did no good!
Installing the virus checker with absolutely no components selected did no good!
Uninstalling the virus checker fixed it!
I now run a different virus checker.
There is (somewhere) on the Keil website, a snippet that discusses this very thing and talks about the complexity of the software components etc - But, sorry, I can't find it at the moment.
David.
Just found the article at:
http://www.keil.com/support/docs/3011.htm
For me, total removal was the only thing that worked.
I seperated all relevant files to a new TEST-project. All files are included correctly as shown below
### uVision2 Project, (C) Keil Software ### Do not modify ! Target (Target 1), 0x0002 // Tools: '166/167' Group (Source Group 1) File 1,2,<.\START_V2.A66><START_V2.A66> 0x0 File 1,1,<.\main.c><main.c> 0x0 File 1,5,<.\systemDefs.h><systemDefs.h> 0x0 File 1,5,<.\CAN_registers.h><CAN_registers.h> 0x0 File 1,5,<.\CAN_config.h><CAN_config.h> 0x0 File 1,5,<.\CAN_constants.h><CAN_constants.h> 0x0 File 1,1,<.\CAN_constants.c><CAN_constants.c> 0x0 File 1,5,<.\CAN_interrupts.h><CAN_interrupts.h> 0x0 File 1,1,<.\CAN_interrupts.c><CAN_interrupts.c> 0x0 File 1,1,<.\CAN_interface.c><CAN_interface.c> 0x0 File 1,5,<.\CAN_interface.h><CAN_interface.h> 0x0 File 1,5,<.\CAN_API.h><CAN_API.h> 0x0 File 1,1,<.\CAN_API.c><CAN_API.c> 0x0
@David: Thanks for the information. I have the Symantec AnitVirus running and I'll check that!
@David: Ok, your case is about none errors at all while building the project, but I do get errors (see down below). And the fact that these problems occur only for McAfee AntiVirus software I do not thinks that that's going to solve it!
Build target 'Target 1' assembling START_V2.A66... compiling main.c... compiling CAN_constants.c... compiling CAN_interrupts.c... compiling CAN_interface.c... compiling CAN_API.c... warning snippet /* CAN_API.C(1021): warnings... */ linking... L166 LINKER/LOCATER V5.21 - SN: **** COPYRIGHT KEIL ELEKTRONIK GmbH 1991 - 2005 "START_V2.obj", "main.obj", "CAN_constants.obj", "CAN_interrupts.obj", "CAN_interface.obj", "CAN_API.obj" TO "TEST" IXREF CINITTAB (0xC00000-0xC3FFFF) *** FATAL ERROR L210: I/O ERROR ON INPUT FILE: EXCEPTION 0021H: PATH OR FILE NOT FOUND FILE: CAN_API.obj Target not created
I too have seen this exact same behaviour, where the file did indeed exist, and is in the proper place, and with the same file attributes as the rest of the files in the project. It drove me crazy for a while, but I found that deleting *all* the temporary files (i.e., saving just the source files, the project.uv2 and project.opt files), exiting the IDE, restarting the IDE, and then doing a build would [temporarily] fix the problem. Don't know why, but this symptom seems to come and go at random. Doesn't happen often, and not on every project, but it's not rare either. It doesn't seem to be microcontroller type related either.
Hope this helps... Dave.
Ok guys (for anybody who cares):
I have my Object-file now!
First of all I fixed all warnings and tried to compile CAN_API.c manually in the console - same thing: no Object-file (same parameters as for all the other files, forced to name the Object-file differently and so on)
So then the problem:
parts of the "super" demo code from Infineon were compiled for another controller as I mentioned earlier. In the problematic file CAN_API.c one function integrates assembler code (for unlocking the protected registers and disabling the TwinCan module by setting bit 13 of register SYSCON3 - just for info). So the developers used the extended inline assembler functionality (#pragma asm) in order to do so. First of all in this case the #pragma SRC directive was neccessary (which, of course was missing) but I fixed that longer time ago. The options for this file were set at their default values (except my try to force the 'Include in Target Build'). So somehow the Assembler SRC-file was always created. BUT nobody assembled the file and hence no object file was created! So first of all I checked each CheckBox 'Generate Assemble SRC File' AND 'Assemble SRC File' in the options window for CAN_API.c and then there it was: more errors, this time from the assembler A166. After fixing the erroneous ASM-Code I finally got my desired Object-file!
Now I have some more Linker-errors do deal with but that's off topic now, I guess.
So thanks to everybody for their inputs! greetz tom
Good description.
This will probably help a number of people who finds this thread later - either because they use the same CAN module, or just have problems with missing obj files.