KDS 3.00 linker not resolving function references

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KDS 3.00 linker not resolving function references

Jump to solution
514 Views
richardfox75
Contributor III

Hello,

 

I have been having problems with the KDS 3 linker not resolving function references. I have prototypes for

all of the functions. But I am unable to call a function, say App_Run() from the main.c file.This morning  I believe

that I have figured out what is happening. My task is to port software from an old product to new hardware,

replacing an 8051 with an ARM processor. The software was originally built with the Franklin C compiler,

so all of the file names are in upper case DOS file names). The code contained in a file named UMAIN05.C is

the old main() function, it calls all of the other functions in the project.

 

It appears that the KDS tools process the files in alphabetical order. When I attempt to call my App_Run() function

which is defined in this file I get undefined references from the linker. However, if I rename the file UMAIN05.C

to say _main.c then the linker is able to resolve the references to function App_Run(). This does not solve my

problem because the file name UMAIN05.C is one of the last file names in the 8051 software. With the new file

name all of the functions which are defined in this file _main.c, are now flagged as undefined references.

 

The references between files main.c and _main.c are now resolved, but all of the functions in files named Uxxxxxx.c

are not resolved.

 

File named _main.c is processed before file named main.c, but is also processed before all of the other files in my

project. Since file main.c is generated by Processor Expert, I can't change it. It looks like I will have to change all of the file

names in the old software. Am I correct? Is there some way to resolve this with out changing file names? Is this really

what the KDS tools are doing? I have changed some of the file names and now these renamed files have function

references resolved.

 

Has anybody seen this type of issue?

 

Thanks,

Richard Fox

Labels (1)
1 Solution
384 Views
richardfox75
Contributor III

Carlos,

I downloaded the latest GNU ARM tools from the launchpad.

After I replaced the tools that KDS was pointing to with the

new tool directories, my project compiles and links with no

errors.

Thanks,

Dick Fox

Firmware Engineer

NATIONAL CONTROLS CORPORATION BUSINESS UNIT

INSTRUMENTATION AND SPECIALTY CONTROLS DIVISION

1725 Western Dr | West Chicago, IL 60185 | http://www.ametekncc.com

Phone: (630)621-3118 | email: Dick Fox@ametek.com

View solution in original post

3 Replies
384 Views
DavidS
NXP Employee
NXP Employee

Hi Richard,

Are you using header files for your declarations?

If not please review following link: C Header Files

As Carlos requested a small example project goes a long way to clarifying things.

Regards,

David

0 Kudos
384 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Richard,

I have not seen this issue before, would it be possible that you upload a sample project where we can reproduce this problem?

Thanks in advance!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos
385 Views
richardfox75
Contributor III

Carlos,

I downloaded the latest GNU ARM tools from the launchpad.

After I replaced the tools that KDS was pointing to with the

new tool directories, my project compiles and links with no

errors.

Thanks,

Dick Fox

Firmware Engineer

NATIONAL CONTROLS CORPORATION BUSINESS UNIT

INSTRUMENTATION AND SPECIALTY CONTROLS DIVISION

1725 Western Dr | West Chicago, IL 60185 | http://www.ametekncc.com

Phone: (630)621-3118 | email: Dick Fox@ametek.com