Hi to all,
Can somebody answer please how can I use GNU compiler in Keil uVision3 evaluation version? Just I need for it because of code limitation. As I am aware to get a compiled unlimited code is possible by configuring the Keil uVision for GNU compiler. Also I'll need for using of GNU libs. Tell me please who knows how to do it. Thanks.
I set the following options for GNU: in the "Options for target" window's linker's tab I have not selected any check box. That means: - do not collect garbage - use Standard System Startup File - use Standard System Libraries - do not use math labriaries
Size for the same project with GNU compiler is 23 668 bytes. Size for the same project with Keil compiler is 10 700 bytes.
Even setting the code optimization into "Level 2(size)" doesn't make any changes.
The GCC and Keil compilers are completely different products from completely different sources - so they are never going to give exactly the same results!
Even "Level 2(size)" will almost certainly mean different things to Keil and GCC.
If this really matters to you, you are going to have to dig deeply into both the Keil and GCC manuals, examine the generated code, etc, etc.
A crude comparison of file sizes has little value.
If you still can't find a set of options that brings the GCC code size down to an "acceptable" level for your requirements, then you are just going to have to pay-up and buy a Keil licence!
Remember, "GCC" is the GNU Compiler Collection - it is a whole range of compilers supporting many different languages and many different targets; Keil, on the other hand, is specifically targetted directly for the ARM architecture alone. One would therefore hope that the Keil compiler would, indeed, give "better" results than the more generalist GCC...
I recommend to read the following link:
www.compuphase.com/dhrystone.htm
Although the old version of Keil tool is referenced, information about GNU ARM based tools are still relevant and I think very useful.
Proper setting of GNU compiler is very important. Then you can expect also very good results from GNU based compilers. Of course, linking some standard functions (e.g. printf) significantly increase the final image.
Thank you for your given link. Unfortunately I couldn't find any useful thing regarding the GNU compiler properly configuration in Keil IDE tool. You have mentioned in your post that GNU compiler can make an effective size code while it has been configured properly. Could you tell me please how can we achieve that results? Thanks.
For GCC support, you'd probably be better going to a GCC forum
Dear Andy,
I think this issue could be discussed in Keil forum more comprehencive than in GNU forum because this issue is related to Keil's IDE configurations to use the GNU compiler. OK, let me ask anoder one question: below I give two configurations for Keil IDE for the same project:
1. GNU-Tool-Prefix: arm-uclibc- Cygnus Folder: C:\Cygnus
2. GNU-Tool-Prefix: arm-elf- Cygnus Folder: C:\Program Files\GNUARM\
For the 1-st configuration compilation and linking passes OK, no warnings.
For the 2-nd configuration I see in Keils IDE output window the following error messages:
/cygdrive/c/Program Files/GNUARM/Bin/../lib/gcc/arm-elf/4.2.0/../../../../arm-elf/bin/ld: ERROR: startup.o uses hardware FP, whereas LCD_GNU.elf uses software FP
/cygdrive/c/Program Files/GNUARM/Bin/../lib/gcc/arm-elf/4.2.0/../../../../arm-elf/bin/ld: failed to merge target specific data of file startup.o
Could anybody give me please a clarification on this matter? Thanks.
"2. GNU-Tool-Prefix: arm-elf- Cygnus Folder: C:\Program Files\GNUARM\"
Cygnus cannot work with spaces in folder names!
Remember: Cygnus is basically unix for windows - and unix doesn't support spaces in filenames
If you want really good results, you should move to the newest GNU releases.
E.g. this is also written on the page that I point you to: >Code generation for Thumb mode has reportedly been >improved in GNU GCC 3.4.3...
Current version is arround 4.2. Not only compiler is improved but also libraries were optimized (and this can have a big influence to the generated code).
What is a problem is the setting of uVision environment for the newest GNU tools as you can see from many threads in the Keil forum. The settings is not as easy as for officialy supported GNU version downloaded form Keil webpages.
"I think this issue could be discussed in Keil forum more comprehencive than in GNU forum because this issue is related to Keil's IDE configurations to use the GNU compiler."
There are two issues here:
(1). Configuring the GCC compiler;
(2). Applying those configurations via the Keil IDE (uVision).
Clearly, before you can think about (2), you have to thoroughly understand (1) - and this is where you need to go to a GCC forum!
Once you know what you're trying to achieve with the GCC compiler (independent of Keil), then (and only then), can you start thinking about how to implement that in uVision - and that's where you need this forum!
"officialy supported GNU version downloaded form Keil webpages."
I think you'll find that GCC is not actually supported by Keil at all - it's purely on a "as-is" basis.
As is generally the case with free software, of course!
Hmmm - don't know what happened there!
The post should've contained the following:
"I give two configurations for Keil IDE for the same project"
You use uVision's multiple Target facility to do this sort of thing. See: http://www.keil.com/support/man/docs/uv3/uv3_ca_projtargfilegr.htm
I personally use CodeSourcery GNU toolchain that is very well maintained. It uses no Gygwin envronment taht is also a big advantage. As I already mention, there are some problems with integration into uVision. Here you can find one of possible solutions:
http://www.keil.com/forum/docs/thread8537.asp
Andy, you are definitely right.
Actually I wanted to say, that GNU version downloaded from Keil webpage works correctly with uVision. This is not the case with newer versions.
Sorry for confusing formulation.
See: http://www.keil.com/support/man/docs/uv3/uv3_dg_armccp.htm
In particular, the last paragraph:
"Compiler Control String Displays the current directives at the Compiler command line."
So you can see exactly what options the dialogue settings are passing to the Compiler!
And the penultimate paragraph:
"Misc Controls Specify any compiler directive for which there is no individual dialog control."
So you can manually specify any settings that aren't directly supported via the dialogue.
Of course, as already noted, you need a thorough understanding of GCC and its available options to make use of these; for this, you need to study the GCC Documentation - and the best support for this is liable to be via the GCC forums...
"Remember: Cygnus is basically unix for windows - and unix doesn't support spaces in filenames"
Unix doesn't have any problems with spaces. It just has a different way of handling them than broken Windoze. If the path is encapsulated in quotes or the space is prefixed by a break character, they will be processed ok.
This requirement is needed to make sure that a path is always processed the same way, insted of the OS trying to auditected if the space is a separator or part of a name.