AnsweredAssumed Answered

Any G++ CPP demo project running on KL?

Question asked by Kai Liu on Sep 8, 2013
Latest reply on Sep 25, 2013 by Monica Arvizu

I am trying to support FRDM-KL25Z with WIRING API, aka Arduino/Wiring projects. And it must be build with GCC. Therefore, I've downloaded many projects build with gcc-arm-none-eabi (GCC-ARM-Embedded). Most of the code can be built and run successfully. Thanks to these project owners of thest open source projects.


It is still headache to port these demo to CPP. I referred an application note from, Building bare-metal ARM with GCC.pdf. It seems we have to modify a lot of things in makefile/linker script/source with patches and custom functions.


Actually I can build it with g++, but when I met following error report.


c:/gcc-arm/gcc-arm-none-eabi-4_7-2013q1-20130313-win32/bin/arm-none-eabi-gcc ./Project_Settings/Startup_Code/startup.o . /Sources/sa_mtb.o ./Project_Settings/Startup_Code/kinetis_sysinit.o ./Sources/main.o ./Sources/mini_cpp.o -mcpu=cortex-m 0 -mthumb -nostartfiles -T./Project_Settings/Linker_Files/MKL25Z128_flash.ld -Wl,,-cref,-no-war n-mismatch    -o LED_Toggle_flash.elf c:/gcc-arm/gcc-arm-none-eabi-4_7-2013q1-20130313-win32/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/ armv6-m\libc.a(lib_a-sbrkr.o): In function `_sbrk_r': sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk' collect2.exe: error: ld returned 1 exit status make: *** [LED_Toggle_flash.elf] Error 1


Does anyone knows what should I to fix it? Thanks in advance.


toolchain: gcc-arm/gcc-arm-none-eabi-4_7-2013q1-20130313-win32

platform: Windows XP



I have attached my project in this thread (the original source comes from


Allan K Liu

Original Attachment has been moved to: