Follow the + star public account and never miss exciting content
Author | strongerHuang
WeChat public account | strongerHuang
Since Keil MDK version V5.36, the Arm Compiler V5 version compiler is not included by default. If you need to use the V5 version compiler, you need to download and install it yourself.
Note: What we are talking about here is the V6 version of the compiler, not the Keil V6 integrated development environment.
The compatibility between Arm Compiler V6 and V5 is not good, and there are many things that need to be paid attention to. Here are a few simple things to note.
Keil modifies ARM compiler and configuration
Many friends may not know how to modify the Keil MDK compiler. Here you can refer to the article I shared before: Teach you step by step how to modify the Keil MDK ARM compiler.
Because the ARM compiler download requires registration, the download may fail due to various reasons. You can refer to the article here: Experience with Keil compiler
Let’s talk about the configuration here. Keil MDK configures AC6 compilation:
Configure optimization options:
Optimization option description
AC6 default, the default value is -O0
. In this case, the code is not optimized and is suitable for online debugging.
Generally recommended for applications that require optimization but are not very critical on speed and time -Os balanced
.
For chips with small memory capacity, -Oz
options are available for optimal code size, this optimization level will degrade the debugging experience.
For projects that have requirements on running efficiency (time), -Ofast
optimized code can be used.
Of course, if you use the armlink command line, there are -Omin, -Omax and other options.
For the optimization options of the AC6 compiler (including many command options), you can refer to my previous article here: Important contents and differences between AC5 and AC6 optimization options
Things to note about AC6
In addition to using regular optimization options in Keil MDK, there are many options that you need to pay attention to when using them.
For example: the option -Omin
will be automatically enabled armclang
-flto
, and the generated object file is not suitable for creating static libraries.
When using -Omin
, -Omax
Arm cannot guarantee optimal code size optimization in all code situations.
Aggressive optimizations performed by enabling -ffp-mode=fast
the armclang option may violate strict compliance with language standards.
------------ END ------------
●Column "Embedded Development"
●Embedded column selected tutorials
Follow the official account and reply " Add Group " to join the technical exchange group according to the rules, and reply " 1024 " to view more content.
Click " Read the original text " to view more sharing.