最近用24FJ64GA004的芯片搞了个东东,代码量超过78%,编译就通不过!用C30的编译器!
开了优化代码之后,就没有问题了,为什么,郁闷.... //================================ 以下是没有开优化的代码: Program Memory Usage
section address length (PC units) length (bytes) (dec) ------- ------- ----------------- -------------------- .reset 0 0x4 0x6 (6) .ivt 0x4 0xfc 0x17a (378) .aivt 0x104 0xfc 0x17a (378) .text 0x200 0x5d74 0x8c2e (35886) .const 0x5f74 0x2670 0x39a8 (14760) .dinit 0x85e4 0x16 0x21 (33) .isr 0x85fa 0x2 0x3 (3)
Total program memory used (bytes): 0xc8f4 (51444) 78%
Data Memory Usage
section address alignment gaps total length (dec) ------- ------- -------------- ------------------- .nbss 0x800 0 0x24c (588) .ndata 0xa4c 0 0xa (10)
Total data memory used (bytes): 0x256 (598) 7%
Dynamic Memory Usage
region address maximum length (dec) ------ ------- --------------------- heap 0 0 (0) stack 0xa56 0x1daa (7594)
Maximum dynamic memory (bytes): 0x1daa (7594)
C:Program FilesMicrochipMPLAB C30inpic30-coff-ld.exe: Error: Not enough contiguous memory for section .const. //================================ 开优化之后的编译结果: Program Memory Usage
section address length (PC units) length (bytes) (dec) ------- ------- ----------------- -------------------- .reset 0 0x4 0x6 (6) .ivt 0x4 0xfc 0x17a (378) .aivt 0x104 0xfc 0x17a (378) .text 0x200 0x40f2 0x616b (24939) .const 0x42f2 0x2670 0x39a8 (14760) .dinit 0x6962 0x16 0x21 (33) .isr 0x6978 0x2 0x3 (3)
Total program memory used (bytes): 0x9e31 (40497) 61%
Data Memory Usage
section address alignment gaps total length (dec) ------- ------- -------------- ------------------- .nbss 0x800 0 0x24c (588) .ndata 0xa4c 0 0xa (10)
Total data memory used (bytes): 0x256 (598) 7%
Dynamic Memory Usage
region address maximum length (dec) ------ ------- --------------------- heap 0 0 (0) stack 0xa56 0x1daa (7594)
Maximum dynamic memory (bytes): 0x1daa (7594)
Executing: "C:Program FilesMicrochipMPLAB C30inpic30-bin2hex.exe" "zzky.cof" Loaded E:hengzhoucodeLCDzzky.cof. BUILD SUCCEEDED: Fri Nov 23 14:23:01 2007
|