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.

Simulate within Eclipse with CCS 4.2.2 and TMS320F283xx derivate

Hi,

using CCS, is it possible to make a simulation of a simple program

e.g.

#include <stdio.h>

void main(void)
{
    printf("Hello World!\n");
}

within ECLIPSE, output is done via output window of Eclipse?

Using the infos in the headline, what is necessary, what is the processing to realize a project?

 

Thanks for any help.

 

JD

  • HI Julian,

    There are many good wiki pages and getting started guides, tutorials, useful links etc from the following main wiki page.  These include project creation, simulation, etc.

    The F283x device does have a CPU simulator available in CCS.   When you create your target configuration, New->Target Configuration File,  you can select Texas Instruments SImulator and will see the F283x simulator there.   The easy thing is to type 28 in the filter box. 

    I actually just ran the hello world example in the simulator.  The "Hello World" is output to the console so you can see it in CCS.

    Here are some good links (the main one I mentioned plus a couple on simulation.

     

    http://processors.wiki.ti.com/index.php/Category:Code_Composer_Studio_v4

    http://processors.wiki.ti.com/index.php/List_of_Simulator

    http://processors.wiki.ti.com/index.php/Category:Simulation

    I hope this will help get you started.

    Best Regards,
    Lisa

  • Hi Lisa,

    currently I got the following error message when running a build,

    what shall I do?

     

     

    **** Build of configuration Debug for project HelloWorld ****

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
    'Building file: ../hello.c'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/C2000 Code Generation Tools 5.1.4/bin/cl2000" --include_path="C:/Program Files/Texas Instruments/C2000 Code Generation Tools 5.1.4/include" --symdebug:dwarf --diag_warning=225 --float_support=fpu32 --large_memory_model --silicon_version=28 --unified_memory --preproc_with_compile --preproc_dependency="hello.pp"  "../hello.c"
    'Finished building: ../hello.c'
    ' '
    'Building target: HelloWorld.out'
    'Invoking: Linker'
    "C:/Program Files/Texas Instruments/C2000 Code Generation Tools 5.1.4/bin/cl2000" --symdebug:dwarf --diag_warning=225 --float_support=fpu32 --large_memory_model --silicon_version=28 --unified_memory -z --reread_libs --warn_sections --search_path="C:/Program Files/Texas Instruments/C2000 Code Generation Tools 5.1.4/lib" --search_path="C:/Program Files/Texas Instruments/C2000 Code Generation Tools 5.1.4/include" --map_file="HelloWorld.map" --rom_model --stack_size=0x300 -o "HelloWorld.out"  "./hello.obj" --library="rts2800_ml.lib" "../28335_RAM_lnk.cmd"
    <Linking>
    fatal error: file "C:/Program Files/Texas Instruments/C2000 Code Generation
       Tools 5.1.4/lib/rts2800_ml.lib<boot.obj>" specifies ISA revision "C2800",
       which is not compatible with ISA revision "C28FPU32" specified in a previous
       file or on the command line


    >> Compilation failure
    gmake: *** [HelloWorld.out] Error 1
    gmake: Target `all' not remade because of errors.
    Build complete for project HelloWorld

    What shall I do now?

     

    JD

  • Hi Julian,

    did you try an unmodified example?  What steps did you take/settings did you use?

    Best Regards,
    Lisa

  • Julian Dieterle said:

    fatal error: file "C:/Program Files/Texas Instruments/C2000 Code Generation
       Tools 5.1.4/lib/rts2800_ml.lib<boot.obj>" specifies ISA revision "C2800",
       which is not compatible with ISA revision "C28FPU32" specified in a previous
       file or on the command line



    In your project properties, select the rts2800_fpu32.lib runtime library. The runtime library should match the compile options, and in this case since you have --float_support=32 option enabled for F28335, this would be the correct library to use.

    Alternately, when you go through the project wizard, leave the Runtime library selection to "automatic". That will automatically pull in the appropriate runtime library based on the your device/build options.

  • Hello Mastermind,

    thanks for that help.

    It seems I am running in another problem:

     


    **** Build of configuration Debug for project HelloWorld ****

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
    'Building file: ../hello.c'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/bin/cl2000" --silicon_version=28 -g --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/include" --large_memory_model --unified_memory --preproc_with_compile --preproc_dependency="hello.pp"  "../hello.c"
    'Finished building: ../hello.c'
    ' '
    'Building target: HelloWorld.out'
    'Invoking: Linker'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/bin/cl2000" --silicon_version=28 -g --large_memory_model --unified_memory -z -m"HelloWorld.map" --stack_size=0x300 --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/include" --reread_libs --rom_model -o "HelloWorld.out"  "./hello.obj" -l"libc.a" "../28335_RAM_lnk.cmd"
    <Linking>
    warning: creating output section ".cio" without a SECTIONS specification
    warning: creating ".sysmem" section with default size of 0x400; use the -heap
       option to change the default size
    "../28335_RAM_lnk.cmd", line 125: error: placement fails for object ".text",
       size 0x182b (page 0).  Available ranges:
       RAML0        size: 0x1000       unused: 0xf8b        max hole: 0xf8b    
    error: errors encountered during linking; "HelloWorld.out" not built

    >> Compilation failure
    gmake: *** [HelloWorld.out] Error 1
    gmake: Target `all' not remade because of errors.
    Build complete for project HelloWorld

    Thanks for all your next help.

     

    JD

  • The "placement fails" error is saying that the size of the .text (code) section is 0x182b but the memory range to which it is being allocated (RAML0) only has 0xf8b unused, so there is insufficient space to allocate the code. This can happen in devices which don't have a lot of memory because the CIO routines such as printf can take up quite a lot of code space.

    http://processors.wiki.ti.com/index.php/C2000_Getting_Started_with_Code_Composer_Studio_v4#Errors_with_.22hello_world.22_project_using_F281x_Devices

    For this particular case you can modify the 28335_RAM_lnk.cmd to combine some of the RAM regions to make it one larger memory. For example, comment out the RAML2 and RAML3 lines within the MEMORY directive and update the RAML1 line:

    RAML1 :

     

    RAML1:     origin = 0x009000, length = 0x003000
    // RAML2 :
    origin = 0x00A000, length = 0x001000
    // RAML3 :
    origin = 0x00B000, length = 0x001000

    This should allow the program to build.

  • Hi Mastermind!

    Thanks for the precious advice.

    May I ask you a last question:


    **** Build of configuration Debug for project HelloWorld ****

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all
    'Building file: ../hello.c'
    'Invoking: Compiler'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/bin/cl2000" --silicon_version=28 -g --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/include" --large_memory_model --unified_memory --preproc_with_compile --preproc_dependency="hello.pp"  "../hello.c"
    'Finished building: ../hello.c'
    ' '
    'Building target: HelloWorld.out'
    'Invoking: Linker'
    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/bin/cl2000" --silicon_version=28 -g --large_memory_model --unified_memory -z -m"HelloWorld.map" --stack_size=0x300 --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/lib" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c2000/include" --reread_libs --rom_model -o "HelloWorld.out"  "./hello.obj" -l"libc.a" "../28335_RAM_lnk.cmd"
    <Linking>
    warning: creating output section ".cio" without a SECTIONS specification
    warning: creating ".sysmem" section with default size of 0x400; use the -heap

       option to change the default size
    'Finished building target: HelloWorld.out'
    ' '
    Build complete for project HelloWorld

    Why are there warnings and how can I avoid them?
    Thank!

    JD

  • Hi Mastermind,

    one more question:

    int main(void)
    {
       int iA = 30000;
       int iB = 10;
       int iC;
       long iD, iE;

       iC = iA * iB;
       iD = (int) (iA * iB);
       iE = iA * iB;

       printf("%d ", iC);
       printf("%d ", iD);
       printf("%d ", iE);
            
       return 1;
    }

     

    Why is the console output -27680 -1 -1

    and not -27680 -27680 -27680?


    JD

  • Julian Dieterle said:

    warning: creating output section ".cio" without a SECTIONS specification
    warning: creating ".sysmem" section with default size of 0x400; use the -heap
    option to change the default size


    The first warning is saying that the compiler is generating a .cio section (for CIO routines) but the linker command file does not have a SECTIONS specification to tell the linker where to allocate it. The linker will allocate it to some default region, which you can look at in the generated link map file (.map). If you wish to change the memory region where it is allocated, you need to add a SECTIONS specification for this section in the linker command file.

    For the second warning, please see this post: http://e2e.ti.com/support/development_tools/compiler/f/343/p/65894/238726.aspx#238726

    The compiler wiki has a lot of great information regarding common compiler errors and issues that users may run into. In addition, the Compiler and Assembly Language Tools Users Guides are great resources: http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals. Also a search on the forums yields answers to many such questions that have been asked before.

     

     

     

  • Julian Dieterle said:

    Why is the console output -27680 -1 -1 and not -27680 -27680 -27680?

    Please see this post which explains the behavior you are seeing.

  • Hello AartiG,

     

    regarding .cio: Thanks for the hint and advice,

    regarding heap: Thanks for the hint and advice.


    JD

  • AartiG said:

    Please see this post which explains the behavior you are seeing.

     

     

    %d in printf says please output the variable iD as int. int on my processor is 16 Bit.

    Regarding the value we have in iD 0xFFFF93E0, iD is long int (32 Bit).

    Using printf, an implicit conversion is done which should result in 0x93E0 but it is 0xFFFF.

    Can you explain why the upper 16 bits are taken and not the lower ones?

    JD

     

  • I believe the results can be unpredicatable if the type of the object being passed to printf does not match the format specifier. Since iD is long, you should print with %ld format specifier.

  • Ok, but other compilers behave differently.

    Thanks for all your help.

    JD