Dear all,
I have some serious issues with the GCC compiler when using a cortex-M0
(STM32F051)
When compiling my code with GCC version 4.6.3, which should support
cortex-M0 microcontrollers, I get next messages:
Error: unknown cpu `cortex-m0'
Error: unrecognized option -mcpu=cortex-m0
When compiling the same code with the codesourcery lite package (same
gcc version), it works fine, however I like to configure my own gcc
version.
I configured GCC with next options:
../configure --target=arm-axon-eabi --prefix=toolchain \
--with-cpu=cortex-m0 --with-mode=thumb \
--enable-interwork --disable-multilib \
--enable-languages="c" --with-newlib --without-headers \
--disable-shared --with-gnu-as --with-gnu-ld \
2>&1 | tee configure.log
Looking in the logging, the cortex-m0 is recognized
Also with the newest version 4.7.2 I have the same problems
Who can help me with this issue?
Regards,
Evert
I use this congfiguration:
../gcc-4.6-4.6.3/gcc-4.6.3/configure --target=arm-none-eabi
--enable-interwork --enable-multilib --enable-languages=c,c++
--with-newlib
--with-headers=/home/user/gcc-4.6.3/newlib-1.18.0/newlib/libc/include
--disable-libssp --disable-nls --with-system-zlib
--prefix=/home/user/gcc-4.6.3/gcc-4.6.3-install
--with-mpc=/home/user/gcc-4.6.3/gcc-4.6.3-install
--with-mpfr=/home/user/gcc-4.6.3/gcc-4.6.3-install
--with-gmp=/home/user/gcc-4.6.3/gcc-4.6.3-install
and I replaced the file gcc-4.6-4.6.3/gcc-4.6.3/gcc/config/arm/t-arm-elf
with the attached file
Hi,
Try this cross-compiler:
https://launchpad.net/gcc-arm-embedded
it is dedicated for various versions of cortex processors. On this page
there is a readme link with info about (I use this for cm3 and cm4).
MacLyon
Depending on where that Error came from exactly, the issue might be
similiar to one I had with AVRs.
There avr-gcc would not complain about -mmcu=atmega8 while avr-ld does
only accept architecture names, i.e. --mmcu=avr4 .
Evert wrote:> Error: unknown cpu `cortex-m0'
Run it as "arm-...-gcc --target-help", and it will tell you which
CPU types are recognized.
I've got an elderly GCC 4.6.0 around, and it properly supports
Cortex-M0 CPUs:
1
$ arm-none-eabi-gcc --target-help
2
The following options are target specific:
3
-mabi= Specify an ABI
4
-mabort-on-noreturn Generate a call to abort if a noreturn function