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.

不被调用的函数也占用FLASH空间?

Other Parts Discussed in Thread: C2000WARE

大家好!

我刚刚学习使用CCS6.2试图对28027进行编程(之前用过CCS3.3对2407做过开发)。

我编译了一个C2000Ware Example后,我在main()之外加了以下测试代码,但没有进行Tst1()调用:

#if 1
volatile Uint16 cntTst1=0 ;
void Tst1( void )
{
cntTst1++ ;
}
#endif

我检查编译后生成的map文件,发现这段代码加入前后,FLASHA的占用发生变化:

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
PAGE 0:

... ...
FLASHA 003f6000  00001f80  000005d9  000019a7  RWIX

加入后:

FLASHA 003f6000   00001f80  000005d1  000019af  RWIX

就是说:没有调用的函数也占用了FLASH空间,这是什么回事??