This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler: Code size much larger on v8.2.2 than 7.4.21

Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

Hello,

I was importing a project that fits into L2 RAM 255kB memory for C6748, created in CCSv5.5 (compiler 7.4.21, optimised for size, no printf float),  to CCSv7.4 (compiler 8.2.2) and the generated firmware size is now larger by 24kB.

Are there more settings in this compiler that I could set so the firmware fits in L2 memory? Below I provided the map files and compiler options for main.cpp and linker command. 

Thank you in advance,

David.

PGM_bootldr.7.4.21.map.txt,PGM_bootldr.8.2.2.map.txt

**** Build of configuration Debug for project PGM_bootldr ****

"C:\\ti\\ccs740\\ccsv7\\utils\\bin\\gmake" -j 8 all -O



'Building file: "../main.cpp"'
'Invoking: C6000 Compiler'
"C:/ti/ccs740/ccsv7/tools/compiler/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6748 --abi=eabi -O3 -ms3 -g --optimize_with_debug=on --preinclude="C:/Camlin/PGM/branches/David/PGM_sysbios/Include/platform.h" --include_path="C:/Camlin/PGM/branches/David/PGM_sysbios/Utils" --include_path="C:/Camlin/PGM/branches/David/PGM_bootldr" --include_path="C:/Camlin/PGM/branches/David/PGM_bootldr/Drivers" --include_path="C:/Camlin/PGM/branches/David/PGM_bootldr/Modules" --include_path="C:/Camlin/PGM/branches/David/PGM_sysbios/Include" --include_path="C:/Camlin/PGM/branches/David/libYAFFS" --include_path="C:/Camlin/PGM/branches/David/libYAFFS/Core" --include_path="C:/Camlin/PGM/branches/David/libYAFFS/Direct" --include_path="C:/Camlin/PGM/branches/David/libYAFFS/HAL" --include_path="C:/Camlin/PGM/branches/David/libCanoodle" --include_path="C:/Camlin/PGM/branches/David/libStarterWare/include" --include_path="C:/Camlin/PGM/branches/David/libStarterWare/include/hw" --include_path="C:/Camlin/PGM/branches/David/PGM_sysbios/Modules" --include_path="C:/Camlin/PGM/branches/David/libStarterWare/include/c674x" --include_path="C:/Camlin/PGM/branches/David/libStarterWare/include/c674x/c6748" --include_path="C:/ti/ccs740/ccsv7/tools/compiler/ti-cgt-c6000_8.2.2/include" --gcc --define=c6748 --define=PGM_SVN_REVISION_STRING=\"4381\" --define=CANOODLE_C6000 --diag_wrap=off --display_error_number --diag_warning=225 --gen_func_subsections=on --remove_hooks_when_inlining --printf_support=nofloat --preproc_with_compile --preproc_dependency="main.d_raw" "../main.cpp"
'Finished building: "../main.cpp"'

'Building target: "PGM_bootldr.out"'
'Invoking: C6000 Linker'
"C:/ti/ccs740/ccsv7/tools/compiler/ti-cgt-c6000_8.2.2/bin/cl6x" -mv6748 --abi=eabi -O3 -ms3 -g --optimize_with_debug=on --preinclude="C:/Camlin/PGM/branches/David/PGM_sysbios/Include/platform.h" --gcc --define=c6748 --define=CANOODLE_C6000 --diag_wrap=off --display_error_number --diag_warning=225 --gen_func_subsections=on --remove_hooks_when_inlining --printf_support=nofloat -z --stack_size=0x2000 -m"PGM_bootldr.map" --heap_size=0x3000 -i"C:/ti/ccs740/ccsv7/tools/compiler/ti-cgt-c6000_8.2.2/lib" -i"C:/ti/ccs740/ccsv7/tools/compiler/ti-cgt-c6000_8.2.2/include" -i"C:/Camlin/PGM/branches/David/libYAFFS/Debug" --reread_libs --display_error_number --warn_sections --diag_wrap=off --xml_link_info="PGM_bootldr_linkInfo.xml" --rom_model --unused_section_elimination=on -o "PGM_bootldr.out" "./FileManager.obj" "./IntervalTimer.obj" "./PGMCanPort.obj" "./PGMbootldrTimer.obj" "./PrepareBoot.obj" "./main.obj" "./Drivers/CAN/MCP2515.obj" "./Drivers/Drivers.obj" "./Drivers/RAMController.obj" "./Drivers/SerialPort.obj" "./Drivers/Flash/Flash.obj" "./Drivers/Flash/M25P64.obj" "./Drivers/GPIO/GPIOPins.obj" "./Drivers/SPI/SPICAN.obj" "./Drivers/SPI/SPIFlash.obj" "./Drivers/TWI/DS28CM00R.obj" "./Drivers/TWI/TWI.obj" "./Drivers/Timers/PrecisionTimer.obj" "./Drivers/Timers/Timers.obj" "./Drivers/Timers/tsc_h.obj" "./Drivers/WDT/WDTdog.obj" "./Modules/AIS/ais.obj" "./Modules/TLSF/tlsf.obj" "./Modules/TLSF/tlsf_heap.obj" "./Modules/Version/version.obj" "./Modules/crc32.obj" "./YAFFS_Config/hal_nand.obj" "./YAFFS_Config/yaffscfg.obj" "../linker_dsp.cmd" -l"C:/Camlin/PGM/branches/David/libStarterWare/Release/utils.lib" -l"C:/Camlin/PGM/branches/David/libStarterWare/Release/drivers.lib" -l"C:/Camlin/PGM/branches/David/libStarterWare/Release/system_config.lib" -l"C:/Camlin/PGM/branches/David/libStarterWare/Release/platform.lib" -llibYAFFS.lib -llibc.a
<Linking>
"../linker_dsp.cmd", line 43: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".text" size 0x462e0 . Available memory ranges:
dsp_l2_ram size: 0x40000 unused: 0x25520 max hole: 0x25520
error #10010: errors encountered during linking; "PGM_bootldr.out" not built

>> Compilation failure
makefile:197: recipe for target 'PGM_bootldr.out' failed
gmake[1]: *** [PGM_bootldr.out] Error 1
makefile:189: recipe for target 'all' failed
gmake: *** [all] Error 2

**** Build Finished ****

  • The "optimize for size" switch is the only compiler switch you should need to use. Please post the linker map files for both 7.4.21 and 8.2.2 so we can get a feel for what makes the program so much larger, and we may be able to suggest a remedy.
  • Hi Archaeologist, the "optimize for size" level 3 was used, the files PGM_bootldr.7.4.21.map.txt, PGM_bootldr.8.2.2.map.txt were attached in my original post, are those the required files?
    David.
  • Indeed, those are the correct files; I'm sorry I failed to notice them the first time around. Unfortunately, because .text failed to allocate, this is going to be a bit harder to analyze. I'll take a few minutes with the 7.4.21 version to see if I can get any insight. In the meantime:
    1) Are you using a RAM-only system? Is there any FLASH you could put .text into?
    2) For testing, could you please temporarily make a change to your linker command file to place .text in bootldr_ddr and relink and repost that map file, just so that I can see how big the individual parts of .text are?
  • The issue is most likely the fact that you're using iostream in the program, which is very large, and gets larger in the 8.2.2 release. You should seriously consider changing any C++-style I/O (cout) to C-style I/O (printf), which will be much smaller.
  • Yes, we designed this board without NAND flash since EMIFA is used for high speed ADC. This bootloader is loaded from SPI flash, initialises DDR then loads main firmware from filesystem on a separate SPI flash. It was designed originally for Cortex M4 and fits into 128kB while on this platform using v7.4.21 is almost 255kB.

    Only printf calls were used, although <iostream> was included in one file, I've rebuilt the project without it and now seems to fit in L2, see attached map file.

    Thank you for your help,

    David.

    PGM_bootldr.map.txt