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.

How do I get printf to work in code composer 5 (TMS320C2000) Experimenter Kit

Other Parts Discussed in Thread: CONTROLSUITE

Hi

I am targeting the  (TMS320C2000) Experimenter Kit using code composer 5.  I would like to insert printf's in one of the example programs in the control suite.  Are there insturctions on how to set this up.  When I #include <stdio.h> and do a printf("my printF");  I get the following  error.  What do I have to do to get printf to work?

 

warning: creating output section ".cio" without a SECTIONS specification

warning: creating output section ".sysmem" without a SECTIONS specification

warning: creating ".sysmem" section with default size of 0x400; use the -heap

   option to change the default size

"C:/ti/controlSUITE/device_support/f2803x/v125/DSP2803x_common/cmd/28035_RAM_lnk.cmd", line 112: error:

   placement fails for object ".text", size 0x1c38 (page 0).  Available ranges:

   RAML0L1      size: 0xc00        unused: 0xc00        max hole: 0xc00    

   .text            : > RAML0L1,   PAGE = 0

"C:/ti/controlSUITE/device_support/f2803x/v125/DSP2803x_common/cmd/28035_RAM_lnk.cmd", line 120: error:

   placement fails for object ".econst", size 0x245 (page 1).  Available

   ranges:

   RAML2        size: 0x400        unused: 0xb8         max hole: 0xb8     

   .econst          : > RAML2,     PAGE = 1

warning: entry-point symbol other than "_c_int00" specified:  "code_start"

error: errors encountered during linking; "Example_2803xCpuTimer.out" not

   built

  • Don,

    printf is (relatively) big. You need a decent amount of space for it. It makes some of your sections grow in size. What is happening in your case is that the sections grew larger than the space you are trying to put it in.

    Don Robb said:

    placement fails for object ".text", size 0x1c38 (page 0).  Available ranges:

       RAML0L1      size: 0xc00        unused: 0xc00        max hole: 0xc00    

       .text            : > RAML0L1,   PAGE = 0

    You are trying to put your .text section on RAML0L1 with a size of 0xc00. Including printf made the .text size balloon to a size of 0x1c38. It's now too big. You need to place your .text section somewhere else where there is more space. Same goes for .econst.

    Thanks

    ki

  • Thanks ki.   I am very new to TI development.  I understand what you are saying about needing to place the .text section and .econst section somewhere else with more space.

    It means I need to understand more about memory layout in the 28035.   How do I figure out the amount of space I have avaliable on the 28035? Pasted below is 28035_RAM_lnk.cmd.   For example if I was trying to create this cmd file from scratch where would I look?

     

    MEMORY

    {

    PAGE 0 :

    /* BEGIN is used for the "boot to SARAM" bootloader mode   */

       BEGIN      : origin = 0x000000, length = 0x000002

       RAMM0      : origin = 0x000050, length = 0x0003B0

       RAML0L1    : origin = 0x008000, length = 0x000c00

       RESET      : origin = 0x3FFFC0, length = 0x000002

       IQTABLES   : origin = 0x3FE000, length = 0x000B50    

    /* IQ Math Tables in Boot ROM */

       IQTABLES2  : origin = 0x3FEB50, length = 0x00008C    

    /* IQ Math Tables in Boot ROM */

       IQTABLES3  : origin = 0x3FEBDC, length = 0x0000AA

    /* IQ Math Tables in Boot ROM */

       BOOTROM    : origin = 0x3FF27C, length = 0x000D44

     

    PAGE1 :

       BOOT_RSVD   : origin = 0x000002, length = 0x00004E    

    /* Part of M0, BOOT rom will use this for stack */

       RAMM1       : origin = 0x000480, length = 0x000380    

    /* on-chip RAM block M1 */

       RAML2       : origin = 0x008C00, length = 0x000400

       RAML3       : origin = 0x009000, length = 0x001000

    }

     

    SECTIONS

    /* Setup for "boot to SARAM" mode:

          The codestart section (found in DSP28_CodeStartBranch.asm)

          re-directs execution to the start of user code.  */

       codestart        : > BEGIN,    

    PAGE = 0

       ramfuncs         : > RAMM0     

    PAGE = 0 

    .text            : > RAML0L1,   PAGE = 0

    .cinit           : > RAMM0,     PAGE = 0

    .pinit           : > RAMM0,     PAGE = 0

       .switch          : > RAMM0,    

    PAGE = 0

       .reset           : > RESET,    

    PAGE = 0, TYPE = DSECT /* not used, */

    .stack           : > RAMM1,     PAGE = 1

       .ebss            : > RAML2,    

    PAGE = 1

       .econst          : > RAML2,    

    PAGE = 1

       .esysmem         : > RAML2,    

    PAGE = 1

       IQmath           : > RAML0L1,  

    PAGE = 0

       IQmathTables     : > IQTABLES, 

    PAGE = 0, TYPE = NOLOAD

  • Sorry about the multiple posts of the same thing.  I didnt' realize when I click POST I don't get a notification to say the post was successful.

  • Don Robb said:
    Sorry about the multiple posts of the same thing.  I didnt' realize when I click POST I don't get a notification to say the post was successful.

    No worries. The performance of this forum architecture leaves much to be desired for sure.

  • Don Robb said:
    How do I figure out the amount of space I have avaliable on the 28035? Pasted below is 28035_RAM_lnk.cmd. 

    Since the linker cmd file tells the linker where space is available on the target, it is the best place to look. You need to find a memory range with a length greater than the size of sections you are trying to allocate. There are a few options for your section but none for the first (.text). It is simply too big for any of the defined ranges. The little piccolo kits do not come with a lot of RAM and hence printf is discouraged because it is so resource intensive.

    Don Robb said:
    For example if I was trying to create this cmd file from scratch where would I look?

    Check out section 7.5 of the 28x assembly user's guide:

    http://www.ti.com/lit/ug/spru513d/spru513d.pdf

    It has all the details on how to create a linker command file. You will need to know the actual memory layout of your target, which is usually documented in the guides that comes with the HW.

    Thanks

    ki

  • Thanks ki. 

    So printf's  won't fit due to size constaints.  Is there any other way to write to the console or a file?  I wrote some lin bus reciever code and would like to log/print or do something to see I am getting the correct responses for the id's I send to my slaves.   How do people generally do this type of verifying on the developer kits?  Can you suggest a method I could use to do this type of verification?  Are there any alternatives to the printf that take less space? Or any alternatives at all besides setting a break point and checking memory?

  • Are you using BIOS? they have a printf equivalent that uses a lot less resources. There are also tools in CCS to save contents of memory to a file on the PC at specific locations (basically a breakpoint that will save memory to a file when reached). Are you looking simply for some text to a console of some sort and nothing else?

  • Thanks Ki for helping.  I'm definitly interested in both techniques. 

    1.Saving contents of memory to a file on the PC at specific locations

    2.Printing to the console.

    I would like to use method 2 to start with and method 1 as my final solution so I can verify everything with some unit tests or something.  To answer your questoin "Are you using BIOS"?  I'll have to admit I am a bit of a newbie and I'm not sure how to find out.  I'm compiling and running an example at the following path on the (TMS320C2000) Experimenter Kit

    C:\ti\controlSUITE\device_support\f2803x\v125\DSP2803x_examples_ccsv4\lina_external_loopback

    The above project does contain a linker descriptor file called DSP2803x_Headers_nonBIOS.cmd if that helps?  How can I know if I'm using BIOS?

    Can you point me in the right direction with regard to

    1. Figuring out if I"m using BIOS and understanding what that means?

    2. If I am using BIOS how I might I add the printf that uses less resources..

    3. The technique for logging memroy to a file.

    I really appriecate your help.

     

     

     

     

     

     

     

    .