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?
Sandra, I don't think the syntax of the .s file would work just like that. You need to read the GNU assembler guide and rewrite it.
"You need to read the GNU assembler guide and rewrite it."
Why would you consider it necessary to rewrite the GNU assembler guide?
;)
Thanks.
I have already understood that I should rewrite the .s file, and not the whole guide, ;-)
Assembler files are not portable between different assemblers, and the runtime support required by different compilers is unlikely to be compatible.
Therefore it is probably not helpful to try to port this Keil-specific stuff to GCC.
If you really want to use GCC, then use one of the many complete GCC-based toolsets available for the STM32.
I need to use GNU compiler instead of Keil ARM.
Why? If it's GNU tools you "need" to use, where does KEIL's startup code, designed for use with KEIL's runtime library, written in KEIL's assembler language, even come into the picture?
I am sorry, but this is the first time I have to deal with this stuff. This is the reason I am asking for advice in the discussion forum.
Someone has decided that we must use STM32 and Keil development tools, but my source code includes some libraries compiled with GNU tools.
I am trying to find GCC-based toolsets available for the STM32. Thank you very much, Andy.
eg, source code provided for a Microsoft environment would not be expected to "just work" with Borland's tools, would it?
Even more so for libraries - which are very much environment-specific.
I hope that you are making clear to that "someone" the error of their ways...?!
That "someone" clearly needs to gain a better understanding of the implications of their directives...
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.
The point is that I am a beginner, this is the first time I deal with embbeded systems.
It is not my specific task to do the assemble-compile process, but I am trying to ensure that the source code I have written works according to the specifications I was given.
I have the source code of the library. If I try to compile with Real View compiler, using a STM32f10x template project from Keil toolchain , I get this error: "Trying to use configall_system for unknown compiler".
I realized that uVision has the option of use GNU compiler, and I was trying to use it. But I found the error that I posted at this thread.
Ah! And I have used "someone" because it is easier to me not to use the passive form. ( English is not my mother tongue ;-) Maybe some expresions from my post are not totally correct, excuse me)
Thanks. This forum seems to be worthwhile.
Maybe you could get some help from "http://www.keil.com/"
Your error message sounds like it is part of a
#if A_COMPILER_I_KNOW_ABOUT // do something useful #else #error "Trying to use configall_system for unknown compiler" #endif
Have you searched the code for "configall_system"?
You are right.
//something useful = It is to include the header file "configall_system.h"
This is supposed to be the header file for the Microsoft compiler, defining all system and compiler dependent configuration macros.
By the way, in my evaluation sotfware from Keil there isnÂ't any folder called \KEIL\ARM\GNU, as it appears in the help menu. This is the file where is supposed to be the startup file using gcc. I haven't been able to find this file surfing the internet.
Can anyone help me with this search?
See: http://www.keil.com/forum/docs/thread12738.asp
> Someone has decided that we must use STM32 and Keil > development tools, but my source code includes some > libraries compiled with GNU tools.
Have you actually tried linking the libraries? Objects from recent GCC (ABI compliant) are supposed to work fine. Got to try that myself one day...
Regards Marcus http://www.doulos.com/arm/