Z-STACK协议栈 IAR编译环境
#define MAX_ADDRMAP_ITEM 300//
typedef struct
{
uint8 NetAddr[2];
uint8 MeterAddr[6];
}AddrMap_t;
AddrMap_t AddrMap[MAX_ADDRMAP_ITEM];
void Meter_JoinAddrMap(uint16 routerAddr, const uint8 *phyAddr)
{
//对结构体数组赋值
}
问题:
1.若在Meter_JoinAddrMap()函数中不给结构体数组赋值,编译连接不报错;
2.若在Meter_JoinAddrMap()函数中给结构体数组赋值,连接报错,如下:
Linking
Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment XDATA_N. Unable to place 2 block(s) (0xc02 byte(s) total) in 0x998 byte(s) of memory. The problem occurred while processing the segment
placement command "-P(XDATA)XDATA_N=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:1568-1eff"
Error while running Linker
3.若将MAX_ADDRMAP_ITEM定义为22(或22以下),在Meter_JoinAddrMap()函数中给结构体数组赋值,正常;