Mbed online compiler export problem

Hi,

I have problems with the export function of the online compiler. I am interested to export an example from the online compiler to Simplicity Studio (as I use an EFM32 STK). This has previously worked without any issue, but if I do the same thing now, the compiler throughs some errors. (There is no problem with the code itself as I can still compile it without issues online).

The first compiler error I am getting is: “fatal error: mbed_config.h: No such file or directory”

This appears to be a problem in the include settings when the project is exported (it seems that it doesn’t look for header files in the project directory itself).

If I add the project directory in the include list, I get the following error:
“fatal error: /Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/nano.specs: attempt to rename spec ‘link’ to already defined spec ‘nano_link’”

I have unfortunately no idea what this even means and how to fix it.

In summary, the exported project cannot be compiled out of the box.

What kind of project is this? mbed Classic or mbed OS 5?

I tried one one the board examples (low_power_blinky), which I suppose is still mbed classic.

Could it be this (from this page)?

At the time of writing, there is a known bug in Simplicity Studio which will mess with the linker input ordering. A workaround has been applied so that it works fine when you regularly import your project, but you should make sure not to go to the linker ordering tab on your project’s build properties. Doing so will corrupt the linker input ordering and cause your project to not build anymore due to unreferenced symbol errors.

Should that inadvertently happen, the only solution is to delete your project and re-import using the method described in this document.

edit No it’s not. Same issue for me.

So I don’t really know why mbed_config.h is not generated by Simplicity Studio, but given that it’s empty for the ETM32’s (at least for Giant Gecko), simplest would be to remove the include.

Under Project > Properties > C/C++ Build > GNU ARM C++ Compiler > Miscellaneous remove -include mbed_config.h from the ‘Other flags’ section.

Now it builds fine for me.

Created a bug report here: https://github.com/ARMmbed/mbed-os/issues/2655

Thanks, the solution with the ‘other flags’ got me to the same point as including the path to the mbed-config.h under C and C++ Compiler.

However, I still get the compiler error:
arm-none-eabi-g++: fatal error: /Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/nano.specs: attempt to rename spec ‘link’ to already defined spec ‘nano_link’

I am following the instructions on the link that you supplied (not going to the linker ordering tab), but it does not help me.

Now I tried exporting it for the Giant Gecko, and I get another error, which might be related to the issue you posted about with the linker. Here is the output:

/Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/armv7-m/libc_s.a(lib_a-fflush.o): In function __sflush_r': fflush.c:(.text.__sflush_r+0xa8): undefined reference to__wrap__free_r’
/Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/armv7-m/libc_s.a(lib_a-findfp.o): In function __sfmoreglue': findfp.c:(.text.__sfmoreglue+0xe): undefined reference to__wrap__malloc_r’
/Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/armv7-m/libc_s.a(lib_a-malloc.o): In function free': malloc.c:(.text.free+0x6): undefined reference to__wrap__free_r’
/Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/armv7-m/libc_s.a(lib_a-wsetup.o): In function __swsetup_r': wsetup.c:(.text.__swsetup_r+0x5c): undefined reference to__wrap__free_r’
/Applications/SimplicityStudio_v3/developer/toolchains/gnu_arm/4.8_2013q4/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/lib/armv7-m/libc_s.a(lib_a-makebuf.o): In function __smakebuf_r': makebuf.c:(.text.__smakebuf_r+0x48): undefined reference to__wrap__malloc_r’
collect2: error: ld returned 1 exit status

I reimported the project several times, but the error stays.

If you build using mbed-cli does it build without problems against Giant Gecko?

I had no issues building or linking Blinky using Simplicity Studio for Giant Gecko after fixing the import path…

Hi
Have you resolved your issue?. I have exactly the same problem.

No, unfortunately not. I, however, didn’t have much time to test more. Would be great to get a fix to this issue as I liked to use the debugger in the simplicity ide.