Well, it takes quite a long time to evaluate corresponding makefile/linker script.since invoking different gcc toolchains for ARM cortex-M0 are different in many ways, including:
- -mcpu (values, some uses cortex-m0, some uses cortex-m0plus)
- newlib in CS, nano-newlib in gcc-arm-embedded)
- c++ handling and overhead
- interrupt and startup code
- more
I have tried:
- gcc-arm-embedded (Linux)
- gcc-arm-embedded (Windows)
- Codesourcery 2010q1 (Windows for Arduino and Maple)
- Codesoucery 2013 (Windows)
- Yagarto
- WinARM
Finally I found demos from CooCox (Eclipse based) is quite useful, it will generate code automatically. Then I check its building process and update my makefile/linker script.
You can download the attachment.
PS, the code has not verified yet (an empty main.c) . I just make sure there are no building errors/warnings from gcc.
I will update my post as soon as verification the code.
Current status:
Codesoucery G++ Lite 2010q1
make / cs-make
F:\labs_codesourcery_gcc_cortex_m\KL25Z-Demo>make all
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c startup_coide.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c syscalls.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xadc.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xcore.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xdebug.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xgpio.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xsysctl.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c xuart.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-ar -rv libbare.a startup_coide.o syscalls.o xadc.o
xcore.o xdebug.o xgpio.o xsysctl.o xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-ar: creating libbare.a
a - startup_coide.o
a - syscalls.o
a - xadc.o
a - xcore.o
a - xdebug.o
a - xgpio.o
a - xsysctl.o
a - xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -c main.c
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-gcc -ffunction-sections -fdata-sections -Wall -fmes
sage-length=0 -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 -O0 -I . -nostartfiles -Wl,-Map=KL25Z-Demo.map -O0
-Wl,--gc-sections -L. -Wl,-Tlink.ld -g -o KL25Z-Demo.elf main.o startup_coide.o syscalls.o xadc.o xcore.o xdebug.o xgpio
.o xsysctl.o xuart.o
D:/maple-ide-0.0.12-windowsxp32/hardware/tools/arm/bin/arm-none-eabi-size KL25Z-Demo.elf
text data bss dec hex filename
1740 0 1104 2844 b1c KL25Z-Demo.elf
rm main.o
Teensy demostrates that K20 can be used in Arduino IDE, if this demo goes well. (Teensy works great, but standalone project IDE seems better) I will design a simple IDE with Python/wxPython, (I preferred Python than Java) with wiring C++ API.
Looking for your comments. I don't have enough motivation if it is not attractive to you guys.