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.

Facing problem in printing string and value in console

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN

Hi Team,

I am facing problem in printing string before I print value of variable  with printf.

1:  Printf(" Hello Hi");

This will work fine....

2.  when i try this : 

int i =100;

printf(" Value of i = %x\n", i);

in this case i am not able to display the string  Value of i = , only 64 is displayed.

 Looking for your valuable assistance.

-- Jaggu

  • Are you using MSP430?

    Try making your stack and heap a larger.

    See http://processors.wiki.ti.com/index.php/Tips_for_using_printf

  • Hi,

    After making stack and heap larger, still i have same problem.

    system details: 

    OS - Win 7,

     CCS version -4.2.4.00033 ,

    MCU-- TMS570LS20216

    Pls help

    -- jaggu

  • Have you read and followed the suggestions on that web page?  If that doesn't help, we're going to need to see a complete, compilable test case that reproduces the problem.  Be sure to include the exact command-line options and the version of the compiler (it is different than the CCS version).

  •  

    Hi,

    Please see the problem I face in image inserted.

    Made Stack and heap =0x1400.. what might be the problem with this kind of scenorio.

  • I have no idea. I've never seen this failure mode before.

    Your test case demonstrates that the system is able to display strings and hexadecimal numbers; I have no idea why it would suddenly stop showing the string.  Note that the hex number is preceded by the correct number of characters, it's just that they are all spaces.

    As suggested earlier, we're going to need to see a complete, compilable test case that reproduces the problem.  Be sure to include the exact command-line options and the version of the compiler (it is different than the CCS version).

  • Hi Archaeologist,

    What do you mean " Be sure to include the exact command-line options and the version of the compiler (it is different than the CCS version)."

    Do i need to share the project setting...let me know what window setting is requried to cross check the setting.

     --Jaggu

  • The build log should have the command-line option and compiler version information.

    It's more important that we get a complete, compilable test case.  In some cases, this may mean the entire project.  In other cases, it can be narrowed down to a single C source file.

  • Hi,

    I have attached the build file.

    I cant share project or c file...  code line snap shot is already shown.

    For more clarity on problem i face ... see this image

    --jaggu

    <?xml version="1.0" encoding="UTF-8"?>
    <?fileVersion 3.1.0?>
    
    <ManagedProjectBuildInfo>
    <project id="DAT_SW.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.1061917662" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType">
    <configuration artifactExtension="out" artifactName="DAT_SW" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1828197098" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">
    <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain.998823323" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1265983151">
    <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1537622529" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
    <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex R.TMS570LS20216SPGE"/>
    <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=be32"/>
    <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
    <listOptionValue builtIn="false" value="CCS_MBS_VERSION=4.2.4"/>
    <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
    <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rtsv7R4_T_be_v3D16_eabi.lib"/>
    <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.168639079" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.9.0" valueType="string"/>
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.1573084782" name="TMS470 Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING.1928191116" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING" valueType="stringList">
    <listOptionValue builtIn="false" value="225"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.1278949619" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.32" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.611543978" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.7R4" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.31926685" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.VFPv3D16" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.688105551" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.eabi" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.30597368" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.packed" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH.856874978" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.PRINTF_SUPPORT.1083471525" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.PRINTF_SUPPORT.full" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.STD_LIB_FUNC_DEFINED.1958917517" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.STD_LIB_FUNC_DEFINED" value="false" valueType="boolean"/>
    </tool>
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1265983151" name="TMS470 Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES.1453726584" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES.BE32" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE.993436728" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE" value="&quot;DAT_SW.out&quot;" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE.1000032424" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE" value="&quot;DAT_SW.map&quot;" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE.351885414" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE" value="0x1400" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH.454939147" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH" valueType="stringList">
    <listOptionValue builtIn="false" value="&quot;C:\Program Files\Texas Instruments\ccsv4\tools\compiler\tms470\lib&quot;"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.CINIT_COMPRESSION.1656971800" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.CINIT_COMPRESSION" value="off" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY.1438748579" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY" valueType="libs">
    <listOptionValue builtIn="false" value="&quot;rtsv7R4_T_be_v3D16_eabi.lib&quot;"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE.2107764307" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE" value="0x1400" valueType="string"/>
    </tool>
    <macros expandEnvironmentMacros="true"/>
    </toolChain>
    </configuration>
    <configuration artifactExtension="out" artifactName="DAT_SW" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.1462795918" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release">
    <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.ReleaseToolchain.254767112" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerRelease.171751937">
    <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.209031885" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
    <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex R.TMS570LS20216SPGE"/>
    <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=be32"/>
    <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
    <listOptionValue builtIn="false" value="CCS_MBS_VERSION=4.2.4"/>
    <listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
    <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=rtsv7R4_T_be_v3D16_eabi.lib"/>
    <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1859046272" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.9.0" valueType="string"/>
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerRelease.227254777" name="TMS470 Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerRelease">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING.973129204" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING" valueType="stringList">
    <listOptionValue builtIn="false" value="225"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.952105144" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.32" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.1539266721" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.7R4" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.1425766952" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.VFPv3D16" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.282037899" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.eabi" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.1938095304" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.packed" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH.1048300663" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH" valueType="includePath">
    <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
    </option>
    </tool>
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerRelease.171751937" name="TMS470 Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerRelease">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES.544831552" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.ARM_BIG_ENDIAN_MODES.BE32" valueType="enumerated"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE.520566523" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE" value="&quot;DAT_SW.out&quot;" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE.1392669198" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE" value="&quot;DAT_SW.map&quot;" valueType="string"/>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY.974570264" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY" valueType="libs">
    <listOptionValue builtIn="false" value="&quot;rtsv7R4_T_be_v3D16_eabi.lib&quot;"/>
    </option>
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH.926269081" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH" valueType="stringList">
    <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>
    <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>
    </option>
    </tool>
    </toolChain>
    </configuration>
    <macros/>
    </project>
    </ManagedProjectBuildInfo>
    

  • I'm not sure what it is you sent; it wasn't the build log I was hoping for, but it does have some of the information I need.

    From it, I can determine you are using ARM compiler version 4.9.0 with compiler options --diag_warning=225 --code_state=32 --silicon_version=7R4 --float_support=VFPv3D16 --abi=eabi --enum_type=packed --printf_support=full

    You are using linker options --be32 --heap_size=0x1400 --cinit_compression=off --stack_size=0x1400

    You are using library rtsv7R4_T_be_v3D16_eabi.lib

    You said earlier that you are using TMS570LS20216, which is indeed Cortex-R4.  I don't know offhand whether it supports VFPv3D16, but I'll assume it does.

    That said, I still can't reproduce the problem.  I need to see more of the test case.

  • Do i need to use different library?

    --Jaggu

  • Probably not; if you had used the wrong library, the linker would have given you an error and wouldn't have linked the program.

  • I still can't reproduce the problem.  I need to see more of the test case.

  • Hi,

    Can you please create one small project that will display the case i discussed, and send it to me.

    So that I will configure my project accordingly. Thanks in advance

    --Jaggu

  • Jaggu,

    Are you using a Halcogen based project? If so, could you try modifying one of the example projects for Hercules devices provided for CCS and see if the issue is reproducible? If it is, you could send us that project instead of your own project so we can use it to reproduce the issue at our end. In the meantime, I will also try to find an example and try adding printfs like you have in your code and see if I reproduce the issue.

  • Hi  /AartiG,

    Problem solved.

    In code i have one more configuration file.. there stack is been overwritten.. now is taken care and is working fine.

    Thanks for the suuport  ..

    --Jaggu

     

  • Jaggu,

    Thanks for the update. Glad to hear the problem is solved.