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.

Added SFO() and HRPWM to a project, it gives a strange compile error

Other Parts Discussed in Thread: TMS320F28035, CONTROLSUITE

I added SFO(), the header files, and I declared everything (the number of channels +1, the global pointers, all that) the way the directions say.  The program STILL won't compile for debug on a TMS320F28035.  It only gives one error, the error is this:

 

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

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

 

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

   .text            : > RAML0L1,   PAGE = 0

 

My starting program was the LED blink example, not the HRPwmDuty SFO example, so there might be a difference in the linker settings or something.  I have no idea where to look though, I can't see any differences in the check boxes.  Help please :(

  • "C:/TI/controlSUITE/device_support/f2803x/v124/DSP2803x_common/cmd/28035_RAM_lnk.cmd", line 112

    is this:

       .text            : > RAML0L1,   PAGE = 0

     

    Why does the program compile just fine when I comment out

    status = SFO();

    But I get the above error when that line is included?

  • Hi,

    This error tells you that there is not enough free memory to place the ".text" segment. You have got 0xC00 free, the .text segment needs 0xCAD. That is too much.

    I do not know which memory areas you defined, but you can try to rearrange your layout (e.g. put another segment from RAML0L1 somewhere else), or you can try to split the .text segment and put some modules somewhere else.

    Best regards and good luck
    Edwin Krasser

  • Nick,

    That line of code tells the compiler to put the .text code into RAML0L1.  When you include the SFO() function, it looks like the compiled code ends up larger than the size of RAML0L1.  This is why it is complaining. 

    If you notice, in your first post, RAML0L1 is size 0xc00 but .text is size 0xcad

    Try changing the line in question to use a different, larger section of RAM.  Or you can try redefining the RAM allocation.

  • Wouldn't TI have made the default location for code the largest one? If the code doesn't fit here... maybe it won't fit anywhere in the chip?

  • Check the map file to figure out if there is enough free memory of not.

    Best regards
    Edwin Krasser

  • The solution was to open the 28035_RAM_lnk.cmd file and change line 87

       RAML0L1    : origin = 0x008000, length = 0x001000  /*Length was 000c00*/

    and lines 119-121

       .ebss            : > RAML3,     PAGE = 1 /*Was L2*/

       .econst          : > RAML3,     PAGE = 1 /*Was L2*/

       .esysmem         : > RAML3,     PAGE = 1 /*Was L2*/

     

    Now I am using all available memory to run the program.  Thank you for pointing out the memory thing, I never would have guessed.