Hello
The programm I have is all fine, the compiler can compile it and the linker link it. But there is one c-file which the keil u vision 5 IDE can not handle correctly somehow. If I hover over a function from that particular file, right click on it and select "Go to Defintion" the undefined Defintion/Reference exception pops up (Like I said the proramm works fine. I can download it to my F7 chip and it works). I could live with that pitty, but the linter (static code analysis) does also have the same issue and throw some error. I know I could just suppress the erros and warning from the linter too, but I am curious why the keil has a problem with this file. Does anybody had an idea why this happens and how it could be solved?
Thanks in advance best regards Fabio Bucher
In that case, the "reference" must be in code that is never used.
Presumably, it is disabled by some #if ... ?
Or is that source file simply excluded form the build ?
Well thats the funny thing, it is code which is used and compiled. It is my driver to regulate the exposer time of a laser. And it works over the interfaces just perfectly. Can it be the codesize, because our Keil environment is not very perfomant anymore. A general "go to definition" command can take up to 10 or more seconds. And compilation of the entire project takes several minutes (7-15min, depends on which hardware).
Codesize: Program Size: Code=408452 RO-data=758768 RW-data=12912 ZI-data=369768
An addendum: For the interested parties, the compiler version we use is 5050106 (ARMCC V5.05, Build 106).
It's not being obfuscated through preprocessor stuff, is it?
Or 'inline' ... ?
No there are no preprocessor macros and no inline functions neither. The declaration in the associated H-file is no problem for the IDE, it can jump to it just fine. When I am in the debbuging mode and jump into a function from this specific module - no problem neither.
That's why I am curious...
Hello Fabio,
* In the Project window, Icons on the folder the file is in, and the file itself identify the item type and permissions. Refer to File, Group, and Component Attributes for details. If one of those have a special icon, look it up here:
http://www.keil.com/support/man/docs/uv4/uv4_ca_filegrp_att.htm
An excluded file won't be built
* Do a rebuild all, and then check the Build log to make sure you are bringing in the proper pack files:
http://www.keil.com/support/docs/3734.htm
Make sure the log shows that file you are having with got compiled.
* Close all the tabs in the editor, and reopen them using the project window, to make sure you are not looking at an old file
* Double-click the target name to open the linker mapping file (*.map). (see http://www.keil.com/support/man/docs/uv4/uv4_projwin.htm for details )
Do a <ctrl + F> search for your function names in the map file.
In particular, look for a section called "Removing Unused input sections from the image."
If the linker does not think a function is used, then it removes that code. Removed code won't have debug information
See: www.keil.com/.../armclang_link_pge1362065927214.htm
* Under Project-> Options for target -> on the Listing tab, check "c Preprocessor listing"
http://www.keil.com/support/man/docs/uv4/uv4_dg_adslst.htm
Press OK, and then translate the troublesome C file - this will make a <filname>.i in your project's listing folder. Open this *.i file in a text editor - it shows the result of all the #If and other preprocessor directives. Look to see if your functions are excluded by these commands.
(note - generating preprocessor files slows down compiling - so make sure to turn off this feature when you are done troubleshooting)