最近在LPC2109上调试ENC28J60,协议栈使用的是UIP,刚开始用的telnet服务,能够正常编译运行。然后换成webserver提示:
enc28j60.axf: Error: L6406E: No space in execution regions with .ANY selector matching uip.o(.bss). enc28j60.axf: Error: L6407E: Sections of aggregate size 0x2204 bytes could not fit into .ANY selector(s).
很是奇怪,然后把芯片换成大一点的发现ZI-data增加了很多。
然后看了网上查了下关于ZI-DATA的信息,又看了MDK的手册,下面是手册对于这几个数据的解释:
RO Data Shows how many bytes are occupied by read-only data. This is in addition to the inline data included in the Code (inc. data) column. RW Data Shows how many bytes are occupied by read-write data. ZI Data Shows how many bytes are occupied by zero-initialized data.
以及他们的存储信息:
Example 2. Image component size informatioCode (inc. data) RO Data RW Data ZI Data De 3712 1580 19 44 10200 7436 Object Totals 0 0 16 0 0 0 (incl. Generated) 0 0 3 0 0 0 (incl. Padding) 21376 648 805 4 300 10216 Library Totals 0 0 6 0 0 0 (incl. Padding) =============================================================================== Code (inc. data) RO Data RW Data ZI Data Debug 25088 2228 824 48 10500 17652 Grand Totals 25088 2228 824 48 10500 17652 ELF Image Totals 25088 2228 824 48 0 0 ROM Totals =============================================================================== Total RO Size (Code + RO Data) 25912 ( 25.30kB) Total RW Size (RW Data + ZI Data) 10548 ( 10.30kB) Total ROM Size (Code + RO Data + RW Data) 25960 ( 25.35kB)
看了网上的篇文章,大概是讲对这些数据的存储的测试验证。
然后自己动手在MDK下测试了下,发现数据很奇怪。
#include <stdio.h> char ix[8]; int main(void) { printf("%c",ix[1]); return 0; }
刚开始用ix[10]->ix[20]->ix[30]测试,发现结果很奇怪。
通过对初始化为0的变量的增加:发现ZI-data是以8为单位增加的。
不解,以前的实验室的师兄告诉我可能是ARM的数据存储是以字为单位,觉得有道理,尝试,定义数组ix[8]->...->ix[12]->ix[16]->ix[20]->ix[24]->ix[25]逐个增加编译
Program Size: Code=4016 RO-data=44 RW-data=20 ZI-data=1508 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1524 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1532 ........... Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1532 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1532 Program Size: Code=4016 RO-data=44 RW-data=12 ZI-data=1540
MDK的ZI-data是以8bytes为单位增加。