Hi @MarcelSch and @Keerthivasan,
Yes, so this is a known issue in the repo readme for windows users. Keerthivasan originally reported & I’ve been chatting with TI on this for support, and thankfully I got some feedback and a workaround.
Basically, ccstudio works by compiling every single .c/cpp file in the project to an object file, and then passing them to the linker. The problem is that depending on what model you’ve output, lots of the tensorflow/cmsis kernel .o files aren’t actually used, but you still end up with a massive linker command (see the ORDERED_OBJS variable in <Project>/Release/makefile
) that is >52000 characters. The windows command line has a hard limit at 32768 characters, and long path name support won’t fix this.
The workaround is that we need to modify the makefile generated by ccstudio to provide a .opt file of objects to the linker instead of writing them all inline. It turns out the IDE already generates this in <project>/Release/ccsObjs.opt
, but the autogenerated makefile does not use it when invoking the linker.
With that, workaround steps are:
- Attempt to build your project normally, such that you have a
<project>/Debug or <project>/Release
directory. This will autogenerate a makefile for your project.
- Open
Project->Properties->Build
, and uncheck “Generate Makefiles automatically”
- Modify the line of
<project>/Release/makefile
that invokes the linker (for my test project, line 953), replacing $(ORDERED_OBJS)
with @"./ccsObjs.opt"
Example of the resulting linker invocation from my resulting makefile:
###@Line 951
# Tool invocations
ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang.out: $(OBJS) $(CMD_SRCS) $(A_SRCS) $(GEN_CMDS)
@echo 'Building target: "$@"'
@echo 'Invoking: Arm Linker'
"/Applications/ti/ccs1110/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang" @"/Users/das/ei_ccs_demo_workspace/ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang/Release/syscfg/ti_ble_app_config.opt" @"/Users/das/ei_ccs_demo_workspace/ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang/Release/syscfg/ti_build_config.opt" @"/Users/das/ti/simplelink_cc13x2_26x2_sdk_5_20_00_52/source/ti/ble5stack/config/build_components.opt" @"/Users/das/ti/simplelink_cc13x2_26x2_sdk_5_20_00_52/source/ti/ble5stack/config/factory_config.opt" -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mlittle-endian -mthumb -Oz -DEI_CLASSIFIER_ALLOCATION_STATIC=1 -DEI_PORTING_TI=1 -DDeviceFamily_CC13X2X7 -DFLASH_ROM_BUILD -DNVOCMP_NWSAMEITEM=1 -gdwarf-3 -march=armv7e-m -Wl,-m"ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang.map" -Wl,-i"/Users/das/ti/simplelink_cc13x2_26x2_sdk_5_20_00_52/source" -Wl,-i"/Users/das/ti/simplelink_cc13x2_26x2_sdk_5_20_00_52/kernel/tirtos/packages" -Wl,-i"/Users/das/ei_ccs_demo_workspace/ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang/Release/syscfg" -Wl,-i"/Applications/ti/ccs1110/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/lib" -Wl,--reread_libs -Wl,--define=FLASH_ROM_BUILD=2 -Wl,--diag_suppress=16002-D -Wl,--diag_suppress=10247-D -Wl,--diag_suppress=10325-D -Wl,--diag_suppress=10229-D -Wl,--diag_suppress=16032-D -Wl,--diag_wrap=off -Wl,--display_error_number -Wl,--warn_sections -Wl,--xml_link_info="ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang_linkInfo.xml" -Wl,--rom_model -o "ei_simple_ble_5_30_CC1352P7_1_tirtos_ticlang.out" @"./ccsObjs.opt" $(A_SRCS)
@echo 'Finished building target: "$@"'
@echo ' '
@$(MAKE) --no-print-directory post-build
The total linker invocation is now only 1768 characters.
I’m adding this workaround to the repo readme and issue as well. I also think it should be possible to get the ccstudio makefile generation to do this automatically, but I’m still investigating.
Best,
David