Generate .elf with KDS 3.0.0

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

Generate .elf with KDS 3.0.0

Jump to solution
2,725 Views
Chiz
Contributor III

Hi,

 

I am trying to build a new project with KDS 3.0.0. The project appears to successfully compile, however I am not able to generate a ".elf" file.

I have imported example projects from KDSK 1.2 (like hello_world), and they all compile successfully, but no elf file is generated.

I've been looking at the documentation on how to build a new project with KDS, but I can't find the problem.

 

Has anyone encountered this issue?

What am I missing, and what should I be looking for?

 

Thanks,
Chiz

Labels (1)
0 Kudos
1 Solution
1,708 Views
Chiz
Contributor III

actually, I found someone else who had the same problem suggested doing the following:

Yes it took the addition of the line

-specs=nano.specs -specs=nosys.specs

in the linker Miscellaneous properties to resolve this

This worked for me. I'm able to link and generate a .srec file.

View solution in original post

0 Kudos
16 Replies
1,708 Views
BlackNight
NXP Employee
NXP Employee

Hello Chiz,

what is the Console view showing? It must show some error text what the problems is.

Select the 'CDT Build Console'

pastedImage_0.png

And you can copy the error messages from there.

I hope this helps,

Erich

0 Kudos
1,708 Views
Chiz
Contributor III

Hi Eric,

The console vie shows no errors... This is is what it shows:

10:52:07 **** Incremental Build of configuration Debug for project kl27LIPSS_FRDM ****

make all

10:52:07 Build Finished (took 80ms)

pastedImage_0.png

0 Kudos
1,708 Views
Chiz
Contributor III

Hi Erich,

I still have not made any head way. I'm not sure what I'm doing wrong or how to go about tracing the root issue.

Can you help?

Thanks,

Chiz

0 Kudos
1,708 Views
BlackNight
NXP Employee
NXP Employee

Same problem if you do a

Project > Clean

?

And what is in your 'Debug' folder (in the root of your project)?

Otherwise: can you share your project?

Erich

0 Kudos
1,708 Views
Chiz
Contributor III

I also noticed that when I clean the project, the .o files are not deleted. They still remain.

0 Kudos
1,708 Views
Chiz
Contributor III

I did it get it to start compiling. I had to uninstall KDS 3.0.0 and reinstall it.

0 Kudos
1,708 Views
BlackNight
NXP Employee
NXP Employee

I doubt that KDS was really the problem (and re-installing changed anything). See my previous analysis. The thing with the 'Refresh policy' seems to be that it can happen after a while.

0 Kudos
1,708 Views
Chiz
Contributor III

I understand what you're saying about the Refresh policy. Uninstalling and Reinstalling KDS allowed me to wipe out the workspace and start afresh. This solved the first problem of not compiling.

I was also aware of the 8192 character limit, and had installed the new GNU tools for windows, which allows you to overcome this problem. This was how I was able to compile in the first place.

I am also linking to the MQX files and have them imported into my project level SDK. The problem I have now is that the linker cannot find some functions which it needs to reference to, like " _kill, _getpid..."

Most of the comments I have seen say it is associated with the linker. I do agree, but I haven't figured it out yet. Perhaps you can help.

I can't attach the project because it is about 52MBs (cleaned and compressed).

Thanks,
Chiz

0 Kudos
1,708 Views
BlackNight
NXP Employee
NXP Employee

I suggest that you remove -specs=nosys.specs from your linker options.

0 Kudos
1,709 Views
Chiz
Contributor III

actually, I found someone else who had the same problem suggested doing the following:

Yes it took the addition of the line

-specs=nano.specs -specs=nosys.specs

in the linker Miscellaneous properties to resolve this

This worked for me. I'm able to link and generate a .srec file.

0 Kudos
1,708 Views
Chiz
Contributor III

Thanks for all your help Erich.

0 Kudos
1,708 Views
Chiz
Contributor III

I have another problem in trying to compile my mqx project. I get a compile error:

c:/freescale/kds_3.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv6-m\libc.a(lib_a-lseekr.o): In function `_lseek_r':

lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'

Since I am using processor expert to build my applicaiton, I didn't think I needed to compile mqx_rtos. I expected that Processor export would import the libaries and files needed.

What am I missing?

0 Kudos
1,707 Views
BlackNight
NXP Employee
NXP Employee

Are you using file I/O on your project?

I see that you have

-lgcc -lc -lsupc++ -lm -specs=nosys.specs -nostartfiles -Xlinker -z -Xlinker muldefs -Xlinker -static

in your linker flags. Is there are special reason you are using these flags?

nosys.specs explicitly tells the linker not to use any system libraries, so you won't have support for file I/O included.

I hope this helps,

Erich

0 Kudos
1,707 Views
Chiz
Contributor III

I'm not using the file I/O on my project. Those flags were set by default when I used Processor Expert to generate code.

I also looked at an example frdmkl27z.kds project and I saw that some of those flags were also set.

I do realize that my Linker is trying to link to a C++ application. .

0 Kudos
1,707 Views
Chiz
Contributor III

I can share my project.

Please see attached.

0 Kudos
1,707 Views
BlackNight
NXP Employee
NXP Employee

Thanks for sharing your project. I noticed several things:

You should enable 'parallel build' to reduce compilation time (see Reducing Compile Time in Eclipse with Parallel Build | MCU on Eclipse ) in the project settings:

pastedImage_1.png

The next thing is very likely the source of your problem: it seems you have renamed your project, but not properly updated the 'Refresh policy'. I see you have

pastedImage_2.png

You need to fix it to:

pastedImage_3.png

See Eclipse Project ‘Refresh Policy’: Broken Incremental Build with External Make? | MCU on Eclipse

for details about this (it is an Eclipse problem).

After that, the build was progressing, but then it run into another problem, and this is probably why it did not link on your machine: the linker command line was exceeding 8192 characters (see Solving the 8192 Character Command Line Limit on Windows | MCU on Eclipse). This especially can happen with MQX+SDK projects which is the case in your project. With using the new Liviu tools (outlined in above article) linking was progressing, but failed because you had not the MQX files added to it. If using MQX, then you need to add these files too.

I hope this helps,

Erich

0 Kudos