Keil V6 compiler performance optimization and precautions

Follow the + star public account and never miss exciting content

c739521f72bf9f919fb874af419ecf93.gif

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:

8d79198ba28ab97051c7a8c95d8d7f4d.png

Configure optimization options:

98042dac15b4f9afe846d0234736c2cf.png

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, -Ozoptions are available for optimal code size, this optimization level will degrade the debugging experience.

For projects that have requirements on running efficiency (time), -Ofastoptimized 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 -Ominwill be automatically enabled armclang -flto, and the generated object file is not suitable for creating static libraries.

When using -Omin, -OmaxArm 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 ------------

b7bcb241f4c0681e985010faf48a79e2.gif

●Column "Embedded Tools "

●Column "Embedded Development"

●Column "Keil Tutorial"

●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.

2c7eb34ea143f7e7882ad57872742c34.jpeg

a25440baa9d32fffa0fa53e984e3fe1a.png

Click " Read the original text " to view more sharing.

Guess you like

Origin blog.csdn.net/ybhuangfugui/article/details/133003335