DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN720 データシートの表示(PDF) - Silicon Laboratories

部品番号
コンポーネント説明
メーカー
AN720 Datasheet PDF : 28 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
AN720
5.6. Unused Code Removal
Each file in a project becomes an object that is included. In other words, if any functions in a file are used, then the
entire file is included by default. This can become an issue for a project using the si32HAL and only a few functions
from each module.
Removed (unused) functions can be viewed in the map files for the projects.
For Precision32, the -ffunction-sections and -fdata-sections optimization flags place each function and data item
into separate sections in the file before linking them into the project. This means the compiler can optimize out any
unused functions. These flags are present in Example and AppBuilder projects by default and should be configured
on a file-by-file basis. To add or remove these options to a file:
1. Right-click on the file_name in the Project Explorer view.
2. Select Properties.
3. In the C/C++ BuildSettingsTool Settings tabMCU C CompilerMiscellaneous options, add or
remove the -ffunction-sections and -fdata-sections flags after the -fno-builtin flag to the Other flags
text box.
Figure 7. Modifying the Remove Unused Code Compiler Flags in the Precision32 IDE
These flags must be compiled with the --gc-sections linker command, which is enabled by default in the
Precision32 IDE. It is recommended that this linker command always remain enabled. These flags only have a
benefit in some cases, and may cause larger code size and slower execution in some cases.
Using the sim3u1xx_Blinky and demo_si32UsbAudio default examples in the si32HAL 1.0.1 software package,
Table 10 and Table 11 show the relative Debug build sizes with different unused code removal settings. For no
unused code removal, the projects were compiled without -ffunction-sections and-fdata-sections and with --gc-
sections. For the examples with unused code removal, the projects were compiled with -ffunction-sections, -
fdata-sections, and --gc-sections. Table 12 shows the CoreMark build sizes, and Table 13 shows the CoreMark
scores for the different unused code removal settings.
14
Rev. 0.1

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]