mimi123 wrote:you can use the normal GCC with -nostdlib -mcpu=cortex-m0 .
You will only need downloading libgcc_s
That works in theory, but I ran into trouble when trying to compile anything more complicated than a simple blinky.bin.
The ideal solution for me was to replicate the experience as on a regular desktop, so I compiled arm-none-eabi-gcc (with newlib, gmp, mpfr, mpc etc.) on the Raspberry Pi. The toolchain is based on Yagarto. Scripts that install a precompiled version can be found here:
https://github.com/ARMinARM/arminarm
It installs cleanly to '/opt/arminarm/, but you can put it anywhere you want. The install scripts should be simple enough to figure out what to change if you want things differently. The install scripts for extra tools (openocd, dfu-util, etc) might come in handy as well.
The examples compile for the Cortex M3 chip for the board I'm selling, but the toolchain should work for M0 as well (I tested it to work for M4). I'm interested to hear if it works for your M0.
If you want to compile the toolchain yourself:
https://github.com/ARMinARM/arm-toolchain-build-scripts