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.

Demo Project Example_28377SLaunchPad Compiler Warnings

Hi,

When building the Example_28377SLaunchPad project (using CCS V6.1.1.00022) I get the following 7 compiler warnings. As a rule, I like to understand and resolve all warnings. Neglecting doing this often leads to (sometimes subtle) problems down the road. Can anyone help me (and others) do this?

1. Build variable 'XDAIS_CG_ROOT' cannot be resolved.
2. creating ".esysmem" section with default size of 0x400; use the -heap
3. creating output section ".cio" without a SECTIONS specification
4. creating output section "TrigRegsFile" without a SECTIONS
5. entry-point symbol other than "_c_int00" specified:  "code_start"
6. Invalid project path: Include path not found (\packages\ti\xdais).
7. variable "fid" was set

Re. the last warning, #7, compilers usually say something like this: "variable "xyz" was set but never referenced". Should this be corrected?

Thanks in advance for your help.

Ed

  • Update: Deleting "${XDAIS_CG_ROOT}/packages/ti/xdais" in the include options brought the warnings down to the following four:

    1. variable "fid" was set
    2. entry-point symbol other than "_c_int00" specified: "code_start"
    3. creating output section ".cio" without a SECTIONS specification
    4. creating ".esysmem" section with default size of 0x400; use the -heap

    For item 2, "Example_2806xSci_Echoback_linkInfo.xml" sets code_start to 0x80000. Obviously that came from a different project, and the file, where detailed linker information is saved, is specified in the project properties linker output dialog, but I can't find where the assignment of code_start to 0x80000 happens in the project properties. Does anyone know? Is it from the ROM autoinitialization model (--rom_model, -c)?

    I suppose the last 2 items are simply defaults because they are not explicitly specified.
  • I am not familiar with your particular example project.  But I can shed some light.

    Edward Schwartz said:
    1. variable "fid" was set

    The code assigns something to this variable, but the variable is never read after that.  It all but certain this variable has been optimized out of the code.  So whether to do anything about this is a matter of preference. 

    Edward Schwartz said:
    2. entry-point symbol other than "_c_int00" specified: "code_start"

    The linker sees the switch --entry_point=code_start (might be in the link command file).  For C/C++ code, entry point symbol is usually _c_int00.  It is likely this project overrides this setting on purpose.

    Edward Schwartz said:
    3. creating output section ".cio" without a SECTIONS specification

    This is more worthy of concern.  The .cio section is a memory buffer used by C I/O functions like printf.  Many embedded systems cannot support the C I/O functions.  Please see this wiki article for more background.  If, after reading that, you are comfortable with using C I/O functions in your code, then you need to change the link command file to explicitly place the .cio section in memory that can be read and written, i.e. not flash.

    Edward Schwartz said:
    4. creating ".esysmem" section with default size of 0x400; use the -heap

    The .esysmem section is the area of memory managed by malloc and related functions.  The linker is saying this section is being sized to the default, and it is being placed wherever space can be found for it.  You probably want to explicitly size it and place it in memory.  Size it with the -heap option, and place it in the link command file.

    Thanks and regards,

    -George

  • Update 2: The comments at the top of "F2837xS_CodeStartBranch.asm" has more info. The entry point is set to the .global label "code_start" with the -e linker option (however I only see "--entry=code_start") to run asm code to disable the watchdog, the it branches to _c_int00. It does say in the comments. "The compiler may warn that the entry point for the project is other then ;// _c_init00." However, does anyone know where code_start is assigned to 0x80000?

  • Thanks, George. I didn't see your post until after I posted my "Update 2" reply below. I'll study what you said.

    (Originally I thought I was posting in the C2000 microcontroller forum regarding the Example_F28377xLaunchPadDemo, but I suppose when I put a tag for the compiler, it got posted in this forum.)

    I still cannot find where code_start is set to 0x80000. If/when I do, I'll post. If anyone knows, please reply. Thanks all.
  • Update 3: As George said, the assignment of code_start is in a link command file. I found the file, 2837xS_Generic_FLASH_lnk.cmd.

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

       BEGIN            : origin = 0x080000, length = 0x000002

    Then in SECTIONS at line 65 is where the assignment takes place:

       codestart           : > BEGIN       PAGE = 0, ALIGN(4)

    Note it's called "codestart" not "code_start" as it is in the detailed link information database file, Example_2806xSci_Echoback_linkInfo.xml, but I'm getting close!

    (I'm not familiar with the syntax for cmd files, so I'm not sure what ">" or ">>" (used elsewhere in the file) means. But whatever...)


    Thanks.

  • Edward Schwartz said:
    (I'm not familiar with the syntax for cmd files, so I'm not sure what ">" or ">>" (used elsewhere in the file) means.

    Learn about link command files with this wiki article.

    Thanks and regards,

    -George

  • Thank you, George. Now I see ">" means "allocate", while ">>" means allocate, but if it doesn't fit, split the remaining across the other ranges listed.

    Do you have any insight as to why the discrepancy between "code_start" seen in the map and xml files, and "codestart" used in the cmd file?
  • Edward Schwartz said:
    Do you have any insight as to why the discrepancy between "code_start" seen in the map and xml files, and "codestart" used in the cmd file?

    codestart (no underscore) is the name of an output section.  code_start is the name of a symbol.

    Thanks and regards,

    -George