How to use GNU ARM binutils for cortex-M4? When I try to compile with -mcpu=cortex-M4 -march=armV7e-m I get 'bad value in switches'.
Hi Jvanmont,
it would depend on the GCC Compiler version what compile switches are valid. If your compiler supports the switches, you should specify them by lower case letters. That is, -mcpu=cortex-m4 -march=armv7e-m.
Best regards,Yasuhiko Koumoto.
Using build-in specs.
Target: arm-elf
Configured with: ../gcc-4.1.1/configure --target=arm-elf --prefix=/g/gnuarm-4.1.1 --enable-interwork --enable-multilib --with-float=soft --with-newlib --with-headers=../newlib-1.14.0/newlib/libc/include --enable-languages=c,c++
Thread model: single
gcc version 4.1.1
Hi jvanmont,
unfortunately gnuarm4.1.1 seems not to support "-mcpu=cortex-m4 -march=armv7e-m" switches. It might only support -mthumb switch. In order to specify such compile switches, you should use more newer version of the gcc.
Is there some optimal version of GNU arm for cortex-m4?
Compilers get better over time, in terms of code generation quality. I would suggest trying the latest compiler version you can lay your hands on.
HTH, Pete
View all questions in Arm Development Studio forum