大家好,最近碰到的问题很奇怪,
我对协议栈进行升级,结果,程序编译的时候都通过了,问题出在链接过程,
1.IAR9.30 zstak:Z-Stack Home 1.2.2a.44539,底层除了 hal_key 和hal_board_cfg文件还有zcl上面的attrid宏定义之外,其他的没动,
2.我的app层文件在旧版本协议栈上可以顺利通过,所有包括option的配置都一样,但是新版本有两个项目不能通过
第一个:说Xdata不够,显示问题(map文件):
Error[e16]: Segment XDATA_I (size: 0xdb align: 0) is too long for segment definition. At least 0x78 more bytes needed. The problem occurred while processing the segment placement command "-Z(XDATA)XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:1e9d-1eff"
Reserved ranges relevant to this placement:
XDATA:1-236 XSTACK
XDATA:237-1eff XDATA_Z
BIT:0-7 BREG
BIT:80-87 SFR_AN
BIT:90-97 SFR_AN
BIT:a0-af SFR_AN
BIT:b8-c7 SFR_AN
BIT:e8-ef SFR_AN
第二个直接显示问题(map文件):
Error[e46]: Undefined external "ZDiagsUpdateStats::?relay" referred in AddrMgr ( E:\\Projects\zstack\Libraries\TI2530DB\bin\Router-Pro.lib )
这些问题实在是无从下手,因为mac底层的东西一点都没动,求大神给我解答啊,这两天为了这两个都快崩溃了,整搞不懂是个什么机制
Yonghua Pan:
1. 既然XDATA内存不足,那么就把一些比较大的数组定义到CODE区,这样可以节省出XDATA内存;2. 你看一下MAP文件,可以看到各个存储空间的占用量,XDATA是用来存放全局变量的,分别分为XStack,XDATA_Z,XDATA_I和XDATA_N,其中,XDATA_Z用来存放初始化为0的全局变量,XDATA_I用来存放初始化为非零的全局变量,这个通过IAR的设置来调整。
wei shi5:
回复 Yonghua Pan:
有一个二维数组12*87 的,已经定义到__code上了,但是貌似一点效果都没有:unsigned char const __code code_format[csumcodeformat][87],请问是这样定义吗,我详细说一下我修改iar的过程吧:
首先:xdata定义成0x300的时候:
Error[e16]: Segment XDATA_Z (size: 0x1c66 align: 0) is too long for segment definition. At least 0x67 more bytes needed. The problem occurred while processing the segment placement command "-Z(XDATA)XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:301-1eff" Reserved ranges relevant to this placement: XDATA:1-300 XSTACK XDATA:301-1eff XDATA_Z BIT:0-7 BREG BIT:80-87 SFR_AN BIT:90-97 SFR_AN BIT:a0-af SFR_AN BIT:b8-c7 SFR_AN BIT:e8-ef SFR_AN
然后我就把xdata设置成0x300 – 0x68 = 0x298,报错:
Error[e16]: Segment XDATA_I (size: 0xdb align: 0) is too long for segment definition. At least 0xda more bytes needed. The problem occurred while processing the segment placement command "-Z(XDATA)XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:1eff-1eff" Reserved ranges relevant to this placement: XDATA:1-298 XSTACK XDATA:299-1eff XDATA_Z BIT:0-7 BREG BIT:80-87 SFR_AN BIT:90-97 SFR_AN BIT:a0-af SFR_AN BIT:b8-c7 SFR_AN BIT:e8-ef SFR_AN
这次又说xdata_i不够,可是在xcl文件里明明定义了-D_IDATA_END=0xFF // Last address of Idata memory.0xff >0xdb??
wei shi5:
回复 Yonghua Pan:
然后 我在网上看到有改这个的我改成2048 –>#define INT_HEAP_LEN 2048,
结果出现:Error[e46]: Undefined external "ZDiagsUpdateStats::?relay" referred in AddrMgr ( E:\Projects\zstack\Libraries\TI2530DB\bin\Router-Pro.lib )
,map文件最后一段
**************************************** * * * END OF CROSS REFERENCE * * * ****************************************
236 607 bytes of CODE memory 32 bytes of DATA memory (+ 56 absolute ) 7 129 bytes of XDATA memory 192 bytes of IDATA memory 8 bits of BIT memory 561 bytes of CONST memory
我怀疑问题出在第二行: 32 bytes of DATA memory (+ 56 absolute ),求解是什么意思呢
wei shi5:
回复 wei shi5:
已经解决了,调整max_heap_size 就解决了,但是还有Undefined external "ZDiagsUpdateStats::?relay" referred in AddrMgr这个问题没有解决,忧桑
VV:
回复 wei shi5:
在工程目录下需要加两个文件,文件位于 C:\Texas Instruments\Z-Stack Home 1.2.2a.44539\Components\stack\sys
Xingbao Chen:
回复 VV:
感谢VV,
KAI CHEN14:
回复 wei shi5:
请问max_heap_size在哪里调整啊?谢谢!