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.

CCS/TM4C123GH6PZ: Compilation error when using the UARTPrintf function

Part Number: TM4C123GH6PZ

Tool/software: Code Composer Studio

Hello,

I was redirected to the CCS Forum after I asked this question: 

The problem was solved - but if the cause was what Ralph explained - I don't understand why it happened only with UARTprint...

Please help.

  • Hello,
    Ralph's explanation is exactly correct regarding why you needed uartstdio.c.

    Now to your followup question - why only for UARTprintf and not other functions? Your project likely includes driverlib.lib. This library would include the object files which define many of the functions called by your application. That is why you didn't have any linker errors with those. Looks like uartstdio.c is not included in that library. Maybe it is part of another library you can include. The Tiva experts would know that best. But anyway, that is why you need to add uartstdio.c and not some of the others.

    Thanks
    ki
  • So the fact that a file was added to the project and visually exists under the project tree - doesn't yet mean that it's linked ?
  • If uartstdio.c shows up visually in the project tree (via Project Explorer), besides in the "Includes" folder, then that file is part of the project whether linked or added

  • Correction: unless it has been explicitly excluded from the build
  • So if uartstdio.c was to be added (for the purpose of argument) to "Debug" , "targetConfigs" , "Binaries" , etc there wouldn't be a problem ?
    But "Includes" is some kind of a file black hole for CCS ?

    If my understanding is correct - can you please explain the motivation behind this ?
    An approach that goes by "if it's in the project - there's a good reason for it so make it visible automatically" seems more intuitive...
  • shai kon said:
    So if uartstdio.c was to be added (for the purpose of argument) to "Debug" , "targetConfigs" , "Binaries" , etc there wouldn't be a problem ?

    "Debug" is a special generated folder for build output. Do not put any source files in there. Source files in there will also be skipped. It will be picked up in "targetConfigs". "Binaries", like "Includes" is a "pseudo" node and it is not possible to add any source files to it.

    shai kon said:
    If my understanding is correct - can you please explain the motivation behind this ?

    "Includes" is simply a graphical representation of the include search paths added to the project properties. Similar to how "Binaries" is a graphical representation of the executable generated from the project build. It is a quick way for users to see what include search paths are specified in the project properties and if any generated executables are present. It is why they have different icons than the typical "folder" icon. This is something we inherit from stock Eclipse. 

  • Part Number: TM4C123GH6PZ

    Tool/software: Code Composer Studio

    Thanks,

    It's becoming clearer...

    Can you please explain what does "adding to the search path" do ?

    What CCS operation makes use of this search path ?

  • This link may help:
    dev.ti.com/.../
  • Also see the below user's guide (section 2.5.2.1)
    dev.ti.com/.../

    In short, it tells the compiler where to look for header files used in your code.