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
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.