erbal
erbal

Reputation: 727

Unrecognized CPU by ARM gcc

I want to compile a C file for stellaris board. (cortex m4) But the compiler always throws the following errors:

Building file: ../main.c
Invoking: Cross GCC Compiler
arm-none-eabi-gcc -DPART_LM4F120H5QR -DARM_MATH_CM4 -DTARGET_IS_BLIZZARD_RA1 -I/home/erbal/src/stellaris -I/usr/lib/gcc/arm-none-eabi/4.5.1/include-fixed -I/usr/lib/gcc/arm-none-eabi/4.5.1/include -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include -O0 -g3 -Wall -c -fmessage-length=0 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.c"
as: unrecognized option '-mcpu=cortex-m4'
subdir.mk:21: recipe for target 'main.o' failed
make: *** [main.o] Error 1

Upvotes: 4

Views: 3834

Answers (4)

Douglas Daseeco
Douglas Daseeco

Reputation: 3671

Let's say you have the tool chain specific to ARM EABI at /usr/local/arduino-packages-1.6.8, ensure that /usr/local/arduino-packages-1.6.8/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/arm-none-eabi/bin is readable and in the PATH environment variable and its contents have executable permissions.

Upvotes: 0

sengguan
sengguan

Reputation: 1

Need to put the arm-none-eabi-c++ or arm-none-eabi-gcc together with the whole gcc folder [e.g inside arm-none-eabi folder]. Because compiler will depend on others binutils component/files as well.

Upvotes: 0

Sheng Yu
Sheng Yu

Reputation: 1

You can use the GCC -B option to specify the prefix of the tool chain binaries, so the cross-compiler is used instead of the native.

Upvotes: 0

Doub
Doub

Reputation: 1282

You need to install the arm-none-eabi-binutils package in addition to arm-none-eabi-gcc.

Upvotes: 3

Related Questions