我用10版的IAR 打开例程 \projects\ble\SimpleBLEPeripheral\CC2541DB编译不通过。
错误提示如下:
Building configuration: SimpleBLECentral - CC2541EM
Updating build tree...
Linking
Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition. At least 0x8 more bytes needed. The problem occurred while processing the
segment placement command "-Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END", where at the moment of placement the available memory ranges
were "IDATA:48-ff"
Reserved ranges relevant to this placement:
IDATA:8-1f VREG
IDATA:21-40 VREG
IDATA:41-42 XSP
IDATA:43-43 DATA_I
IDATA:44-45 DATA_Z
IDATA:46-47 IDATA_Z
IDATA:48-ff ISTACK
BIT:0-7 BREG
BIT:80-97 SFR_AN
BIT:a0-af SFR_AN
BIT:b8-c7 SFR_AN
BIT:e8-ef SFR_AN
BIT:f8-ff SFR_AN
Error while running Linker
Total number of errors: 1
Total number of warnings: 0
后在官方论坛中找到了答案原因如下:
IAR V8.20以后的版本不再需要NR_OF_VIRTUAL_REGISTERS
具体解释:打开IAR软件,可以在release notes中找到highlights,linker configuration files ,
看到如下信息
其中
-
EW24413: Linker configuration files (with the filename extension .xcl) from version 8.20 or older contain:
-Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F
.
In the 8.30.1 release this internal_NR_OF_VIRTUAL_REGISTERS
symbol was deprecated. In the new version of these files, this changed to:
-Z(DATA)VREG=08-7F
.
This change is now also applied to the Texas Instruments (Chipcon) linker configuration files.
是引起这个问题的最终原因,你需要找到协议栈安装路径$PROJ_DIR$\..\..\common\cc2540\ti_51ew_cc2540b.xcl的这个文件,将-Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F
改为-Z(DATA)VREG=08-7F