This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

如何减小out文件的尺寸



软件环境:ccs5.2

软件工程:image processing 主核程序

硬件平台:6678EVM板

写了个程序,输出的.out文件有45M字节,无法写入nor flash,经分析发现是定义的全局大数组占用了空间,程序里声明了两个大数组,每个数组10MB,除了使用动态内存分配的方法,还有其它途径能减小。out文件尺寸吗?

研究了下.map文件,发现有些段是uninitialized,有些段就不是,例如

.qmss      0    00825a00    00002400     UNINITIALIZED
                  00825a00    00002400     ti.drv.qmss.ae66 : qmss_drv.oe66 (.qmss)


.cppi      0    0082b980    00000200     UNINITIALIZED
                  0082b980    00000200     ti.drv.cppi.ae66 : cppi_drv.oe66 (.cppi)

.far:NDK_PACKETMEM
*          0    0c080380    00052b00     UNINITIALIZED
                  0c080380    00052b00     stk6_ppp_pppoe.ae66 : pbm_data.oe66 (.far:NDK_PACKETMEM)

这两个段就是UNINITIALIZED

 

  • 那些是driver需要用的段,省不了的,除非你自己写driver

    数据尺寸你只能尽量减小全局数组的使用,代码尺寸可以用-ms(0-5)来进行减小,但代码尺寸和性能是成反比的。

    所以还是应当考虑如何优化代码减少不必要的内存使用。