8 years, 5 months ago.

Has anyone exported this program to Kinetis Design Studio successfully?

I have tried repeatedly to export this project to KDS but I can't get it working.

It doesn't compile.

error: arm-none-eabi-g++: error: unrecognized command line option 'gc-sections'

It appears that none of the Cross Arm C++ Linker Setting are being set.

Can anyone help?

Question relating to:

SD card example with the file system (complete). Created for FTF2014 FTF2014, hands-on, lab

3 Answers

8 years, 5 months ago.

Not sure which version of KDS you're using but this may help. https://developer.mbed.org/handbook/Getting-Started-mbed-Exporters#kds

8 years, 5 months ago.

Hi, Robert,

I've tried unsuccessfully to do the same and reached to same conclusion: the linker is not getting the right command line. I'm using the KDS 3.0 and at the linker configuration, on the general tab there is a preview for the command line that will be formed and it is correct, but at run time the command passed is completely different, and I still can't figure why it happens only with this project...

Sorry for having no good answer.

Regards, Marco Haddad

I'll have to install KDS 3.0 to test. The exporter was tested with older version (more than a year ago as I recall it was added).

posted by Martin Kojtal 24 Nov 2015

I think that this may be the reason for the linker bad command line:

KDS-178: Under Windows there is a command line length limitation of 8192 characters. If the command line length to the compiler or linker exceed that limit, the command line gets truncated and the build will fail.

I did not count it but may be the command is too long...

Regards, Marco Haddad

posted by Marco Haddad 25 Nov 2015
8 years, 3 months ago.

I solved this problem by updating the mbed library to the most recent revision before exporting to KDS. Now it compiles fine, debugs fine (except I breakpoints don't work—but that's another issue).

Warning: just don't update the FATFileSystem library to the newest revision though, or you'll break SDFileSystem (as of Jan 2016).

Detail: The problem might be that the older mbed library revision didn't have the right linker script, so it produced a blank linker script entry. The command line output then had a -T without an argument, meaning it ate the subsequent parameter instead, which messed up the rest of the command line.

Thanks for sharing. To test the exporter, you can try to export using project.py in the workspace tools (https://github.com/mbedmicro/mbed).

If you got any problems, report it there on github, as sources for the exporters are there.

posted by Martin Kojtal 18 Jan 2016