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.
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()函数中给结构体数组赋值,正常;
对对。。我现在的系统中,定义的结构体数组(或者普通数组,刚才试了,一样的额),在不赋值的情况下,大小大于184BYTE没有关系,不报错,但是在程序中赋值后,就报错。。
也就是说我现在系统中,只要想给定义的数组赋值,就必须将定义的数组大小设置为小于184 byte??
但是我现在的项目中需要 300*8 byte,该怎么处理这个问题,希望能指点。。。。
就是定义的结构体数组变量。。
typedef struct
{
uint8 NetAddr[2];
uint8 MeterAddr[6];
}AddrMap_t;
AddrMap_t AddrMap[300];
300 -> 22(或者更小,22*8)之后,给这个数组变量赋值就没有问题。。但是我现在至少要300个
cc2530.
152 270 bytes of CODE memory
32 bytes of DATA memory (+ 72 absolute )
7 929 bytes of XDATA memory
192 bytes of IDATA memory
8 bits of BIT memory
169 bytes of CONST memory
Errors: none
Warnings: none
这是sample工程中map文件中的memory情况,保证不报错,数组使用的最大情况(也就是上面说的22,换成23就会报错)。。
能不能再请教你个问题:
CC2530的flash是256KB,SRAM是8K,CODE、DATA、XDATA、IDATA、BIT、CONST哪些是存储在flash?哪些是存储在SRAM?
能不能再请教你个问题:
CC2530的flash是256KB,SRAM是8K,CODE、DATA、XDATA、IDATA、BIT、CONST哪些是存储在flash?哪些是存储在SRAM?