2013-01-31 04:06 AM
Trying to get a linux toolchain up and running to eventually program an STM32L Discovery board. I have Code Sourcery CodeBench Lite set up in a folder and a Make script set up to build it all. Right now it's just a skeleton program, consisting of a main.c, startup_stm32l1xx_md.s, and system_stm32l1xx.c. When I run the script, it compiles for a bit and then I get these errors:
/home/dsampson/arm-dev/arm-gcc/bin/arm-none-linux-gnueabi-gcc -T../stm32_flash.ld -mthumb -mcpu=cortex-m3 -o code.elf startup_stm32l1xx_md.o system_stm32l1xx.o main.o /home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: error: startup_stm32l1xx_md.o: Conflicting architecture profiles M/A/home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: failed to merge target specific data of file startup_stm32l1xx_md.o/home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: error: system_stm32l1xx.o: Conflicting architecture profiles M/A/home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: failed to merge target specific data of file system_stm32l1xx.o/home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: error: main.o: Conflicting architecture profiles M/A/home/dsampson/arm-dev/arm-gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.2/../../../../arm-none-linux-gnueabi/bin/ld: failed to merge target specific data of file main.oI ran readelf on each ot the object files, and both startup and main show up as Cortex M3 v7 object files, but it doesn't recognize the system_stm32l1xx.o file as being valid. I tried deleting it and recompiling but no luck. It's the system file I pulled out of the firmware pack for the L1 Discovery board so I would think it's a valid file. Any ideas what could be going wrong?2013-01-31 04:15 AM
I think it would be helpful to post the make file, too.
Perhaps you have compiled the C file(s) with wrong/missing/default architecture specification, i.e.-mcpu
and-march
settings. At least the error messages sound like this.2013-01-31 04:19 AM
2013-01-31 04:47 AM
-arch=armv7-m'
to the cflags ?2013-01-31 11:57 AM
Same result
2013-01-31 02:09 PM
I think with GNU/GCC I've always used the arm-none-eabi chains for the STM32.
You should look at the options passed to the assembler and make sure they are coherent with those used by the compiler/linker.