This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

stm32f10x_vector.s with GNU compiler

I am using Keil uVision3 in order to compile a .cpp file using STM32F103VE microcontroller.
I need to use GNU compiler instead of Keil ARM.

I am using the file stm32f10x_vector.s from the library of Keil\ARM\Startup\ST.
The problem appears when I try to assemble this file with GNU ( "error: unknown cpu 'cortex m3')

Maybe I have to change the assembler control string "-mpcu=cortex-m3", but what should I put?

Or maybe the problem is that this file is for Keil Arm compiler. Where could I find a startup file for this controller compiling with GNU?

Parents
  • The immediate problem: A compiled library for one compiler is only compatible with other code compiled with that same compiler.

    But a more important issue: Do you have the sourcecode for the library? If you have, then you may be able to port the code to build with another compiler. If you don't, then that is a very dangerous library to use in a commercial project. You may find a critical bug in the library and not be able to fix it - and the support may be dropped.

    And you may find that you have one version of the compiler, but a bug fix is only available for another version of the compiler. Note that even if you do everything with gcc - at least for C++, the gcc compiler have changed their ABI several times, i.e. the binary bindings and how structures, datatypes, name mangling, calling conventions are described.

Reply
  • The immediate problem: A compiled library for one compiler is only compatible with other code compiled with that same compiler.

    But a more important issue: Do you have the sourcecode for the library? If you have, then you may be able to port the code to build with another compiler. If you don't, then that is a very dangerous library to use in a commercial project. You may find a critical bug in the library and not be able to fix it - and the support may be dropped.

    And you may find that you have one version of the compiler, but a bug fix is only available for another version of the compiler. Note that even if you do everything with gcc - at least for C++, the gcc compiler have changed their ABI several times, i.e. the binary bindings and how structures, datatypes, name mangling, calling conventions are described.

Children