AnsweredAssumed Answered

code size problem ,reduce the code size

Question asked by Cathy chang on Jul 17, 2012
Latest reply on Jul 18, 2012 by Cathy chang

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.

MQX Code Size Report

MAP Fileintflash.elf.xMAP

MQX Core Components Code (ROM)
MQX Core Code1297
MQX String Code-
MQX Scheduler Code2606
Interrupt Management Code918
Lightweight Memory Manager Code1328
Lightweight Semaphore Code776
Memory Manager Code506
Processor Support Code940
Queue Management Code298
Task Management Code2622
Time Management Code3825
Task Queues Component Code612
MQX Optional Components 
Event Component Code-
Idle Task Code-
I/O Subsystem Code5338
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 Code4498
Mutex Component Code-
Semaphore Component Code-
Name Component Code-
Partition Component Code1422
Command-line TAD Code-
MPU Support Code-
Other PSP Code420
Total of MQX PSP Code27406

BSP Vector Table1024
BSP Bootstrap Loader Code-
Board Initialization Code355
BSP Interrupt Management Code620
Clock Management Code-
Low Power Management Code-
A/D Driver Code-
APC Flash Driver Code-
Ethernet Driver Code1932
Ethernet Phy Driver Code492
Ethernet FEC Driver Code5186
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 Code3978
SPI Driver Code-
FlexCan Driver Code-
msCan Driver Code-
Display Driver Code-
DIU Driver Code-
Trivial File System Code-
Timer Driver Code312
SD Card Driver Code-
eSDHC Driver Code-
Other BSP Code652
Total of BSP Code14551

Summary of MQX Libraries Code (ROM)
Total of MQX PSP Code27406
Total of BSP Code14551
Total of MFS Code-
Total of RTCS Code62989
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 Code17697

Overall Total
All ROM Code and Initialized Data sections124197


  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?