由于需要实现CC1310的 OAD 升级功能,但是按照官方教程simplelink_cc13x0_sdk_1_50_00_08/examples/rtos/CC1310_LAUNCHXL/easylink/rfWsnNodeIntFlashOadClient/README.html 的指导在编译oad image 时出现编译错误。
错误为:compile error is :../CC1310_LAUNCHXL_TIRTOS_OAD.cmd", line 86: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".const" size 0x4c58 . Available memory ranges:
FLASH size: 0xeff0 unused: 0x3a06 max hole: 0x39f6
error #10010: errors encountered during linking; "rfWsnNodeIntFlashOadClient_CC1310_LAUNCHXL_tirtos_ccs.out" not built.
问题定位到是程序flash空间不够引起的,因为oad image做了必须小于60KB的限制,但是官方给的工程在CCS7下编译后的大小超过了60KB,无法编译成功。生成oad image的操作步骤按照官方给出的指引:
Building the hex file in CCS
- Import the CCS porject into CCS(for more information conslt the Examples Users Guide in the proprietary-rf documentation)
- If this is for an OAD image (not an image to be flashed), then exclude the ccfg.c file from the project.
- Add FEATURE_OAD_ONCHIP and HAL_IMAGE_A or HAL_IMAGE_B to the predefined Symbols in Project->Properties Arm Compiler / Predefined Symbols tab (for Image B the TIRTOS config file must also be changed, see below).
- Add FEATURE_OAD_ONCHIP=1 and HAL_IMAGE_A=1 or HAL_IMAGE_B=1 to the Linker symbol definition in Project->Properties ARM Linker->Advanced Options / Command File Preprocessing tab (for Image B the TIRTOS config file must also be changed, see below).
- Enable hex file conversion in Project->Properties Arm Hex Utility
- Set memory width to 8 in General options
- Set output format to intel hex.
- Make a code change update the nodeFwVersion string in NodeTask.c
- build
其中在 定义宏FEATURE_OAD_ONCHIP和 HAL_IMAGE_A的时候,会改变编译条件,在CC1310_LAUNCHXL_TIRTOS_OAD.cmd文件中将程序的flash 空间的最大值设置为0xEFF0 。
CC1310_LAUNCHXL_TIRTOS_OAD.cmd:
#if defined(FEATURE_OAD_ONCHIP)
#if defined(HAL_IMAGE_B)
#define FLASH_BASE 0x10000
#define FLASH_SIZE 0xEFF0
#else // HAL_IMAGE_A
#define FLASH_BASE 0x1000
#define FLASH_SIZE 0xEFF0
#endif
#else
#define FLASH_BASE 0x1010
#define FLASH_SIZE 0x1EFF0
#endif
我尝试将编译oad image时的flash SIZE 改回0x1EFF0,编译通过,但是由于其超过了60KB的大小,无法生成一个可以正常使用的升级包。
官方都给出的教程是否有不完善的地方?是否能改变CCS7的一些编译设置减小程序flash部分的大小?寻求帮助和解决办法。
使用的SDK是simplelink_cc13x0_sdk_1_60_00_21 和 simplelink_cc13x0_sdk_1_50_00_08,现象完全一致。