hi everyone,
I want to reduce the code size . i reduced the code of psp/bsp and so on ,but the changed of the .s19'code is so small. i dont know which one is the improtant about code size?
1. in CodeWarrior Tools ,we can see code and data.
for example:
File code data
-MQX libraries 99k 8554
-RTCS libraries 80172 15992
-Source 13592 5691
2. the size of intflash.elf.s19
intflash.elf.s19 266KB
3. read the MQX Code Size Report be created by codesize.exe about intflash.elf.xMAP.
MAP File | intflash.elf.xMAP |
Compiler | cwcf7 |
MQX Core Components Code (ROM) | |
MQX Core Code | 1297 |
MQX String Code | - |
MQX Scheduler Code | 2606 |
Interrupt Management Code | 918 |
Lightweight Memory Manager Code | 1328 |
Lightweight Semaphore Code | 776 |
Memory Manager Code | 506 |
Processor Support Code | 940 |
Queue Management Code | 298 |
Task Management Code | 2622 |
Time Management Code | 3825 |
Task Queues Component Code | 612 |
MQX Optional Components | |
Event Component Code | - |
Idle Task Code | - |
I/O Subsystem Code | 5338 |
Kernel Log Component Code | - |
Lightweight Event Component Code | - |
Lightweight Log Component Code | - |
Lightweight Message Component Code | - |
Lightweight Timer Component Code | - |
Log Component Code | - |
Message Component Code | 4498 |
Mutex Component Code | - |
Semaphore Component Code | - |
Name Component Code | - |
Partition Component Code | 1422 |
Command-line TAD Code | - |
MPU Support Code | - |
Other PSP Code | 420 |
Total of MQX PSP Code | 27406 |
MQX BSP Code (ROM) | |
BSP Vector Table | 1024 |
BSP Bootstrap Loader Code | - |
Board Initialization Code | 355 |
BSP Interrupt Management Code | 620 |
Clock Management Code | - |
Low Power Management Code | - |
A/D Driver Code | - |
APC Flash Driver Code | - |
Ethernet Driver Code | 1932 |
Ethernet Phy Driver Code | 492 |
Ethernet FEC Driver Code | 5186 |
NAND Flash Driver Code | - |
FLASH Driver Code | - |
GPIO Driver Code | - |
I2C Driver Code | - |
PC-Card Driver Code | - |
Real Time Clock Driver Code | - |
Serial Port Driver Code | 3978 |
SPI Driver Code | - |
FlexCan Driver Code | - |
msCan Driver Code | - |
Display Driver Code | - |
DIU Driver Code | - |
Trivial File System Code | - |
Timer Driver Code | 312 |
SD Card Driver Code | - |
eSDHC Driver Code | - |
Other BSP Code | 652 |
Total of BSP Code | 14551 |
Summary of MQX Libraries Code (ROM) | |
Total of MQX PSP Code | 27406 |
Total of BSP Code | 14551 |
Total of MFS Code | - |
Total of RTCS Code | 62989 |
Total of USB Host Code | - |
Total of USB Device Data | - |
Total of Shell Code | - |
System Libraries Code (ROM) | |
System Library Code (MSL/EWL...) | 1554 |
User Application-related Code (ROM) | |
Application-specific Code | 17697 |
Overall Total | |
All ROM Code and Initialized Data sections | 124197 |
i want to reduce code size, but i dont know which one is the key factor about code size.
The size (the size of MAX lib + the size of RTCS lib + the size of the Source) is not the same as the size of .s19 ,i want to know what is different about there kinds of size?
Solved! Go to Solution.
Hi cathychang,
Our FTF2012 (Freescale technology Forum) had a class that covered optimization and configuration of MQX:
I find that I do not tune the default configuration much but chaning from the debug target to the release target gives the fastest results as the release target turn more compiler optimizations on.
Hope this helps.
Regards,
David
Hi cathychang,
Our FTF2012 (Freescale technology Forum) had a class that covered optimization and configuration of MQX:
I find that I do not tune the default configuration much but chaning from the debug target to the release target gives the fastest results as the release target turn more compiler optimizations on.
Hope this helps.
Regards,
David
Hello cathychang,
If you are willing to reduce code size, your concern is .text section in your map file.
To get familiar with ELF files, read wikipedia article named Executable and Linkable Format and google a bit. You will find out there are more section in ELF file, not only data and code.
How much kB reduction is your goal ?
Regards,
MartinK
i want to reduce code size into 128KB (this is the upper limit).
The size of .s19 file in my project is 303KB after added the USB cdc function .
Summary of MQX Libraries Code (ROM) | |
Total of MQX PSP Code | 27568 |
Total of BSP Code | 14799 |
Total of MFS Code | - |
Total of RTCS Code | 58595 |
Total of USB Host Code | 512 |
Total of USB Device Data | 18640 |
Total of Shell Code | - |
System Libraries Code (ROM) | |
System Library Code (MSL/EWL...) | 1554 |
User Application-related Code (ROM) | |
Application-specific Code | 19645 |
Overall Total | |
All ROM Code and Initialized Data sections | 141313 |
If it only have MQX and RTCS SNMP , the size of .s19 file is about 265KB;
Summary of MQX Libraries Code (ROM) |
|
Total of MQX PSP Code | 27406 |
Total of BSP Code | 14551 |
Total of MFS Code | - |
Total of RTCS Code | 62989 |
Total of USB Host Code | - |
Total of USB Device Data | - |
Total of Shell Code | - |
System Libraries Code (ROM) |
|
System Library Code (MSL/EWL...) | 1554 |
User Application-related Code (ROM) |
|
Application-specific Code | 17697 |
Overall Total |
|
All ROM Code and Initialized Data sections | 124197 |
i want to know how to reduce this code --"All ROM Code and Initialized Data sections" ?