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.

CCS/TMS320F28035: Error when printf used

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi ,

 I am using example C2000Ware: \C2000Ware_XXXX\device_support\f2803x\examples\c28\adc_soc. When i am trying to print something using the printf statement i am getting the following error:


**** Build of configuration Debug for project Example_2803xAdcSoc ****

"E:\\ti\\ccsv8\\utils\\bin\\gmake" -k all

Building target: "Example_2803xAdcSoc.out"
Invoking: C2000 Linker
"E:/ti/ti-cgt-c2000_6.4.2/bin/cl2000" -v28 -ml -mt --cla_support=cla0 -g --define="_DEBUG" --define="LARGE_MODEL" --quiet --verbose_diagnostics --diag_suppress=10063 --diag_warning=225 --issue_remarks -z -m"Example_2803xAdcSoc.map" --stack_size=0x300 --warn_sections -i"E:/ti/ti-cgt-c2000_6.4.2/lib" -i"E:/ti/ti-cgt-c2000_6.4.2/include" -i"C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/examples/c28/adc_soc" -i"C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/common/lib" -i"C:/ti/c2000/C2000Ware_1_00_06_00/libraries/math/IQmath/c28/lib" --reread_libs --issue_remarks --verbose_diagnostics --xml_link_info="Example_2803xAdcSoc_linkInfo.xml" --entry_point=code_start --rom_model -o "Example_2803xAdcSoc.out" "./DSP2803x_Adc.obj" "./DSP2803x_CodeStartBranch.obj" "./DSP2803x_DefaultIsr.obj" "./DSP2803x_GlobalVariableDefs.obj" "./DSP2803x_PieCtrl.obj" "./DSP2803x_PieVect.obj" "./DSP2803x_SysCtrl.obj" "./DSP2803x_usDelay.obj" "./Example_2803xAdcSoc.obj" "C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/common/cmd/28035_RAM_lnk.cmd" "C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/headers/cmd/DSP2803x_Headers_nonBIOS.cmd" -lrts2800_ml.lib -lIQmath.lib

>> Compilation failure
makefile:150: recipe for target 'Example_2803xAdcSoc.out' failed
warning: creating output section ".cio" without a SECTIONS specification
warning: creating ".esysmem" section with default size of 0x400; use the -heap
option to change the default size
"C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/common/cmd/28035_RAM_lnk.cmd", line 143: error:
program will not fit into available memory. placement with
alignment/blocking fails for section ".text" size 0x2400 page 0. Available
memory ranges:
RAML0L1 size: 0xd00 unused: 0xd00 max hole: 0xd00
.text : > RAML0L1, PAGE = 0
"C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/common/cmd/28035_RAM_lnk.cmd", line 152: error:
program will not fit into available memory. run placement with
alignment/blocking fails for section ".esysmem" size 0x400 page 1.
Available memory ranges:
RAML2 size: 0x300 unused: 0x38 max hole: 0x38
.esysmem : > RAML2, PAGE = 1
"C:/ti/c2000/C2000Ware_1_00_06_00/device_support/f2803x/common/cmd/28035_RAM_lnk.cmd", line 151: error:
program will not fit into available memory. placement with
alignment/blocking fails for section ".econst" size 0x248 page 1. Available
memory ranges:
RAML2 size: 0x300 unused: 0x38 max hole: 0x38
.econst : > RAML2, PAGE = 1
error: errors encountered during linking; "Example_2803xAdcSoc.out" not built
gmake: *** [Example_2803xAdcSoc.out] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

could you help me rectify this error.

Regards,

silpa

  • Hi,

    You could allocate the .text, .esysmem, .econst sections to RAMN memories with larger sizes. The section to memory mapping is done as part of the linker command file.
    Additionally, you could use --printf_support (C2000 compiler-> Advanced Options->Library functions assumptions) to minimal or float. This will reduce the memory requirement for printf

    Regards,
    Veena
  • Thanks Veena.

    "You could allocate the .text, .esysmem, .econst sections to RAMN memories with larger sizes. The section to memory mapping is done as part of the linker command file"--How to do this ?

    Regards,
    Silpa
  • Hi Silpa,

    In your .cmd file you would probably have something like below under SECTIONS
    .text : > RAMx

    You are facing this error since your .text size is bigger than the RAMx size (RAM origin and sizes are defined under MEMORY in .cmd file)
    You could either combine multiple RAMs .text : >> RAMx | RAMy ..
    Or, you could assign it to a RAM of larger size .text : > RAMz (where the size of RAMz size more than .text size)

    Regards,
    Veena
  • Hi Silpa,

    I would not recommend the usage of printf in microcintrollers as there are larger in size and consume lot of CPU cycles. A better alternative is the usage of SCI terminal. This opens up a COM port on your PC and allows you to view the characters sent via SCI on a serial terminal like Tera term You could refer to the sci_echoback for more details

    Regards,
    Veena