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.

IAR stack sizes 设置问题

Other Parts Discussed in Thread: CC2530

我的CC2530项目,用到UCOS 操作系统,设置 STACK SIZES,  idata 设置成 0x80 , 系统提示不够用,程序跑飞, 设置成0XC0 ,系统有编译不过去,提示错误为

Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition. At least 0x3b more bytes needed. The problem occurred while processing the segment placement command。  IAR 的版本已经足够新,为9.30, 修改了

Project -> Option -> General Option -> Target Tab

Modify : Number of virtual registers, from 16 --> 8.

也不能解决问题,

修改配置文件中的 ;

-Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F

改成

-Z(DATA)VREG=08-7F

仍然报相同的错误!

请TI遇到此类问题的老师给以指点!谢谢

  • idata最大只能设置为256字节。

    也是就是说如果定义超过256字节的数组,编译器默认分配到idata,但是这是超过idata的大小的因为,我们要做的就是要把数组分配到xdata中去。因此修改如下:

    unsigned char __xdata data[255]  //其中“__”是两个,不是一个“_”

    不再有编译错误,而且可以稳定运行。