This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil uVision 5 can not find Defintion of a Function

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

Parents
  • 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)

Reply
  • 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)

Children
No data