由于需要实现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
#defineFLASH_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,现象完全一致。
Loops:
你好.
请参考我们的文档.
file:///C:/ti/simplelink_cc13x0_sdk_1_60_00_21/docs/proprietary-rf/proprietary-rf-users-guide/cc13x0/oad-easylink/oad_onchip.html
你会发现它的Flash的分配和文档完全一致. 而且你还需要用到BIM.
谢谢.
Loops:
我选的是RELEASE配置,不是DEBUG配置. 编译没有问题. 用的1.60的SDK
Susan Yang:
请问您是否注释了
var ROM = xdc.useModule('ti.sysbios.rom.ROM'); if (Program.cpu.deviceName.match(/CC26/)) {ROM.romName = ROM.CC2650; } else if (Program.cpu.deviceName.match(/CC13/)) {ROM.romName = ROM.CC1350; }可以参考 https://e2e.ti.com/support/wireless_connectivity/proprietary_sub_1_ghz_simpliciti/f/156/p/615974/2274149
maple liao:
回复 Loops:
file:///C:/ti/simplelink_cc13x0_sdk_1_60_00_21/docs/proprietary-rf/proprietary-rf-users-guide/cc13x0/oad-easylink/oad_onchip.html教程的步骤不够全,漏了在linker 里定义 FEATURE_OAD_ONCHIP=1 HAL_IMAGE_A=1 的步骤,加上后在release版本中编译还是会出错。未定义其数据=1不会走到#define FLASH_SIZE 0xEFF0这一步,在CC1310_LAUNCHXL_TIRTOS_OAD.cmd文件里,所以编译能正常通过,但是编译出来的image无法使用。
#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#define RAM_BASE 0x20000000#define RAM_SIZE 0x5000
详细步骤在easylink/rfWsnNodeIntFlashOadClient例程的教程里。file:///C:/ti/simplelink_cc13x0_sdk_1_60_00_21/examples/rtos/CC1310_LAUNCHXL/easylink/rfWsnNodeIntFlashOadClient/README.html
maple liao:
回复 Susan Yang:
没有修改过,单纯地导入工程然后按照工程rfWsnNodeIntFlashOadClient/README.html 里的指引编译,编译image时后发现编译不过。我不太清楚你贴的代码在哪个文件里
Loops:
回复 maple liao:
你好。
1. FEATURE_OAD_ONCHIP=1在ARM Compiler – PredefinedSymbol里面已经定义了。
2。我按照上述定义好后没问题的。编译通过。(A和B都测试过都可以)
2。
maple liao:
回复 Loops:
您好,请你按照文档 file:///C:/ti/simplelink_cc13x0_sdk_1_60_00_21/examples/rtos/CC1310_LAUNCHXL/easylink/rfWsnNodeIntFlashOadClient/README.html
中Building the hex file in CCS的第四步,定义FEATURE_OAD_ONCHIP=1 和HAL_IMAGE_A=1
Loops:
回复 maple liao:
你好。我发现是工程的PATCH 导致的CONST太大。我把对应的RF_Mode 变量修改后可以正常编译。举例如下,一共有7个。但是不打补丁肯定会影响性能。我和产品确认一下。
RF_Mode RF_prop_fsk ={ .rfMode = RF_MODE_PROPRIETARY_SUB_1, .cpePatchFxn = 0, .mcePatchFxn = 0, .rfePatchFxn = 0,};
maple liao:
回复 Loops:
不太明白PATCH的作用,以及你说的 7个要修改的RF_Mode 变量具体作用?能详细解释一下么,或者我应该去查看哪些资料?