We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I created a static library for the micro-ecc project using GNU Arm Embedded Toolchain:arm-none-eabi-gcc -Wall -c uECC.cand armar:armar -rcs libuECC.a uECC.o
I added the library file to my Keil Project and I get this error:
Build started: Project: xxx*** Using Compiler 'V5.05 update 1 (build 106)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'Build Project 'app_main' - Target 'xxx'linking....\release\xxx.axf: Error: L6366E: uECC.o attributes are not compatible with the provided cpu and fpu attributes .Object uECC.o contains Build Attributes that are incompatible with the CPU attributes.Tag_CPU_arch = ARM v4T (=2)Tag_THUMB_ISA_use = Thumb instructions were permitted to be used (=1)Tag_ARM_ISA_use = ARM instructions were permitted to be used (=1).\release\xxx.axf: Error: L6242E: Cannot link object uECC.o as its attributes are incompatible with the image attributes.... wchart-16 clashes with wchart-32.... arm-isa clashes with m-profile.Not enough information to list image symbols.Not enough information to list load addresses in the image map.Finished: 8 information, 0 warning and 2 error messages.".\release\xxx.axf" - 2 Error(s), 0 Warning(s).Target not created.Build Time Elapsed: 00:00:02
If I try to link just the object file on its own (not a static library), I get the same error.
I realize that I'm using an old version of the ARM compiler and upgrading might fix these issues; but I just wanted to know if there is a workaround that I could try first.
Surely, the messages are telling you which parts are in conflict:
Anvi said:Build Attributes that are incompatible with the CPU attributes.Tag_CPU_arch = ARM v4T (=2)Tag_THUMB_ISA_use = Thumb instructions were permitted to be used (=1)Tag_ARM_ISA_use = ARM instructions were permitted to be used (=1)
and
Anvi said:attributes are incompatible with the image attributes.... wchart-16 clashes with wchart-32.... arm-isa clashes with m-profile.
For a start, it looks like your project is Cortex-M, but the library is ARM7TDMI ?
I see, thank you for your response. I'm trying to find documentation for the GNU ARM Embedded Toolchain on how to modify these attributes when compiling the library object. I can't seem to find anything explicit
I attempted to re-compile using my target cpu name:
arm-none-eabi-gcc -Wall -O3 -mcpu=cortex-m3 -c uECC.c
error: target CPU does not support ARM mode
Anvi said:and I get this error:
Well, you would: a Cortex-M3 indeed does not support ARM mode - it is Thumb only.
Anvi said:how to modify these attributes when compiling the library object. I can't seem to find anything explicit
Did you read the 'Compilation Notes' in the documentation on the Github page you linked?
Have you tried contacting the author?
I see, I understand. I re-compiled using the following flags:
arm-none-eabi-gcc -Wall -O3 -fshort-wchar -mthumb -mcpu=cortex-m3 -mfix-cortex-m3-ldrd -c uECC.c
I'm able to link the resulting object into my project now. Thanks for you guidance