CC2640/2650 IAR环境编译报错Error while running “D:\ti\xdctools_3_31_01_33_core\xs”原因分析

  • 2016-12-11
  • 2,687
  • 1
  • 2

在2015年初的时候打算在产品里使用CC2640芯片,然后装好IAR以后一直碰到这个奇怪的问题,一直没解决,最后导致公司里做产品暂时放弃了该方案,因为当时比较急
最近得到了一块CC2650 SensorTag,在烧写程序的时候还是碰到了这个问题,所以我就又把这个问题拿出来分析了一下,开发环境是这样的:

XDCTOOLS和ti_rtos都装在D:\ti

IAR装在D:\IAR Systems\Embedded Workbench 7.3

以前开发的时候倒是从来没出现过问题,唯独在CC2650系列的时候总是会出现问题而且这个问题属于预编译脚本出的问题。本着探究的精神就来研究了一下,一般来说这个错误都长这样:

Building configuration: CC2650App – FlashOnlyOAD
Updating build tree…

48 file(s) deleted.
Updating build tree…
Performing Pre-Build Action
Error while running “D:\ti\xdctools_3_31_01_33_core\xs” –xdcpath=”D:\ti\tirtos_simplelink_2_13_00_06\products\bios_6_42_00_08\packages” iar.tools.configuro -c “D:\IAR
Systems\Embedded Workbench 7.3\arm” –cc “D:\IAR Systems\Embedded Workbench 7.3\arm\bin\iccarm.exe” –device “CC2650F128” –compileOptions “-D
POWER_SAVING -D GATT_TI_UUID_128_BIT -D FEATURE_REGISTER_SERVICE -D FEATURE_OAD -D FACTORY_IMAGE -D USE_ICALL -D
TI_DRIVERS_PIN_INCLUDED -D TI_DRIVERS_I2C_INCLUDED -D TI_DRIVERS_SPI_INCLUDED -D HEAPMGR_SIZE=2872 -D ICALL_MAX_NUM_TASKS=8 -D
ICALL_MAX_NUM_ENTITIES=11 -D CC26XXWARE -D CC26XX -D xdc_runtime_Assert_DISABLE_ALL -D xdc_runtime_Log_DISABLE_ALL –diag_suppress Pa050 -o D:\ti\
simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\FlashOnlyOAD\Obj –debug –endian=little –cpu=Cortex-M3 -f D:\ti\
simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\..\..\..\..\..\..\..\Projects\ble\config\buildComponents.opt -f D:\ti\simplelink\
ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\configPkg\compiler.opt.defs -f D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\
ble\SensorTag\CC26xx\IAR\Application\CC2650\..\..\Config\IAR-Boundary.bdef -e –fpu=None –dlib_config \”D:\IAR Systems\Embedded Workbench 7.3\arm\INC\c\
DLib_Config_Normal.h\” -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\ -I D:\ti\simplelink\
ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650/../../../Source/Application\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\
SensorTag\CC26xx\IAR\Application\CC2650/../../../../../../../Projects/ble/Include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\
Application\CC2650/../../../../../../../Projects/ble/ICall/Include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/Roles/CC26xx\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/Roles\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/Keys\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/DevInfo\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/SensorProfile/cc26xx\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/Profiles/OAD/cc26xxST\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Projects/ble/common/cc26xx\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/applib/heap\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/ble/hci\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/ble/controller/CC26xx/include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/ble/host\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/hal/target/CC2650TIRTOS\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/hal/target/_common/cc26xx\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/hal/include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/osal/include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/services/sdata\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/services/saddr\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/icall/include\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/icall/ports/tirtos\ -I D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\
CC2650/../../../../../../../Components/ble/include\ -I D:\ti\tirtos_simplelink_2_13_00_06\products\cc26xxware_2_21_01_15600\ -I D:\ti\tirtos_simplelink_2_13_00_06\packages\ -I
D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650/../../../Source/Application/Board_patch/interfaces\ -I D:\ti\simplelink\
ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650/../../../Source/Application/Board_patch/devices\ -I D:\ti\simplelink\
ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650/../../../Source/Application/Board_patch/CC26XXST_0120\ -Ohz” –linkOptions “-o D:\ti\
simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\FlashOnlyOAD\Exe\SensorTagAppFlashOnlyOAD.out –config_def
FLASH_ONLY_BUILD=1 –map D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\FlashOnlyOAD\List\
SensorTagAppFlashOnlyOAD.map –config D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\cc26xx_ble_app.icf
–keep __vector_table -f D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\configPkg\linker.cmd -f D:\ti\simplelink\
ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Application\CC2650\..\..\Config\IAR-Boundary.xcl D:\ti\tirtos_simplelink_2_13_00_06\products\
cc26xxware_2_21_01_15600\driverlib\bin\iar\driverlib.lib –entry __iar_program_start –vfe” –profile release –projFile “D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\
ble\SensorTag\CC26xx\IAR\Application\CC2650\CC2650App.ewp”

Total number of errors: 1
Total number of warnings: 0

看上去报了一大堆其实就1个错误,就是预编译脚本D:\ti\xdctools_3_31_01_33_core\xs执行失败。记得第一次安装的时候,按照官方的路径设置IAR,安装后仍然是这个问题。我就懵了,最后看了脚本才知道,错误原因竟然是这个:

D:/IAR:not found

奇怪了,怎么会有D:/IAR这个路径呢,找了半天也没找出来,后来还定位到这个错误是在编译Bios的时候出错的,对应的文件是:

D:\ti\simplelink\ble_cc26xx_2_01_01_44627\Projects\ble\SensorTag\CC26xx\IAR\Config\src\sysbios\makefile

打开一看总算明白了:

CC = LC_ALL=C D:/IAR Systems/Embedded Workbench 7.3/arm/bin/iccarm $(CCOPTS)

ASM = LC_ALL=C D:/IAR Systems/Embedded Workbench 7.3/arm/bin/iasmarm –cpu Cortex-M3 –endian little

AR = LC_ALL=C D:/IAR Systems/Embedded Workbench 7.3/arm/bin/iarchive

这明显是unix风格的编译脚本,但是上面好像路径里出现了空格,显然是没有转义所以导致路径截断了。

但是,直接修改脚本貌似不行,因为这个预编译脚本是由IDE在Build的过程中自动产生的,每次编译都会重新生成这个文件,所以最后想了个办法,就是只能改IAR的安装路径了,让安装路径不带空格,问题成功解决。当然,改这里也是可以的:

把这两个路径分别替换成IAR的安装目录,我直接把D:\IAR Systems\Embedded Workbench 7.3\arm这整个文件夹复制到D:\IAR\arm,用D:\IAR\arm替换TOOLKIT_DIR,D:\IAR\arm\bin\iccarm.exe替换COMPILER_PATH,然后保存编译,就再也没有出现过这个蛋疼的问题了。

最后吐槽下xdctools+windows可能确实不是很好使,不过这也告诉我们路径的问题还是要注意,尽量用下划线_代替空格,因为毕竟空格在unix下需要加’\’来转义,而windows下不用,因此造成了这个兼容性问题。

总算是折腾完了,这里mark一下分享给有同样情况的朋友~~

评论

  • maydolly回复

    问题解决,感谢感谢

发表评论

*

浙ICP备16016405号-2
浙公网安备 33010602007544号