SPMU373A March   2021  – August 2022 TM4C1230C3PM , TM4C1230D5PM , TM4C1230E6PM , TM4C1230H6PM , TM4C1231C3PM , TM4C1231D5PM , TM4C1231D5PZ , TM4C1231E6PM , TM4C1231E6PZ , TM4C1231H6PGE , TM4C1231H6PM , TM4C1231H6PZ , TM4C1232C3PM , TM4C1232D5PM , TM4C1232E6PM , TM4C1232H6PM , TM4C1233C3PM , TM4C1233D5PM , TM4C1233D5PZ , TM4C1233E6PM , TM4C1233E6PZ , TM4C1233H6PGE , TM4C1233H6PM , TM4C1233H6PZ , TM4C1236D5PM , TM4C1236E6PM , TM4C1236H6PM , TM4C1237D5PM , TM4C1237D5PZ , TM4C1237E6PM , TM4C1237E6PZ , TM4C1237H6PGE , TM4C1237H6PM , TM4C1237H6PZ , TM4C123AE6PM , TM4C123AH6PM , TM4C123BE6PM , TM4C123BE6PZ , TM4C123BH6PGE , TM4C123BH6PM , TM4C123BH6PZ , TM4C123BH6ZRB , TM4C123FE6PM , TM4C123FH6PM , TM4C123GE6PM , TM4C123GE6PZ , TM4C123GH6PGE , TM4C123GH6PM , TM4C123GH6PZ , TM4C123GH6ZRB , TM4C123GH6ZXR , TM4C1290NCPDT , TM4C1290NCZAD , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1297NCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C129CNCPDT , TM4C129CNCZAD , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XNCZAD

 

  1.   Read This First
    1.     About This Manual
    2.     Glossary
    3.     Related Documentation From Texas Instruments
    4.     Support Resources
    5.     Trademarks
  2. 1Introduction to TivaWare SDK
    1. 1.1 TivaWare SDK Folder Breakdown
  3. 2TivaWare Example Projects
    1. 2.1 TivaWare Development Board Examples
    2. 2.2 TivaWare Peripheral Examples
    3. 2.3 How to Import an Example Project into CCS
  4. 3Linking Files and Libraries into a TivaWare Project in Code Composer Studio
    1. 3.1 Linking Files in CCS
    2. 3.2 Linking Libraries in CCS
  5. 4How to Debug a TivaWare Library
    1. 4.1 How to Direct Code Composer Studio to a Source File
    2. 4.2 How to Rebuild TivaWare Libraries
  6. 5How to Add TivaWare to an Existing CCS Project
    1. 5.1 Path Variables
    2. 5.2 Include Paths
    3. 5.3 Predefined Variables
    4. 5.4 Library Linking
  7. 6TivaWare Boot Loader
    1. 6.1 Modifying a TivaWare Project for Boot Loading in Code Composer Studio
    2. 6.2 How to Boot Load with LM Flash Programmer
  8. 7Software Best Practices
    1. 7.1 Stack / Heap Settings and Stack Overflow
    2. 7.2 Interrupt Service Routines
      1. 7.2.1 Best Practices
      2. 7.2.2 TivaWare Vector Tables and IntDefaultHandler
    3. 7.3 TivaWare Hardware Header Files
    4. 7.4 ROM and MAP TivaWare Prefixes
  9. 8TM4C Resources
  10. 9Revision History

Linking Files in CCS

For this section, the single_ended peripheral examples under examples/peripherals/adc will be used as a reference.

Following the steps in Section 3.2, project0 for the EK-TM4C123GXL LaunchPad was used as the starter TivaWare project. The project name was renamed to 'single_ended', which allows project0 to be imported again in the future. After copying the source code into the project0.c file and trying to compile the project, the build errors seen in Figure 4-1 occur.

GUID-20201218-CA0I-N54W-J8HP-PPTQRTR6K9LZ-low.jpg Figure 3-1 CCS Build Error - Unresolved Symbols

 

The ‘unresolved symbol’ error usually occurs when a function call is used without the proper .c source files added to the project. This usually occurs when a project uses files outside of a provided TivaWare library like DriverLib or UsbLib. If a header file is added with a #include from a TivaWare library directory then check to ensure the corresponding .lib file has been added to the project. If so, no further actions need to be taken. Section 4.2 will cover how to add a .lib file if it is missing from a project.

In this case, two UART related functions are causing the issue: UARTprintf and UARTStdioConfig. As this example is for an existing TivaWare example project, the quickest way to understand what file is missing would be to scroll up to the #include statements at the top of the code project. Upon doing so, the following lines related to UART can be found:

#include "driverlib/uart.h"
#include "utils/uartstdio.h"

As mentioned before, since driverlib files are already included with the .lib file, the uartstdio.c file would be the next file to check to see if it is missing. Looking through the list of files in the project indicates that there is no uartstdio.c file included in the project (Figure 4-2). Searching the contents of the uartstdio.c file in the utils directory of the TivaWare install will reveal that the missing functions are both inside of that file.

GUID-20201218-CA0I-QGPJ-VMXN-3BD8MCBHXQV4-low.jpg Figure 3-2 File List for the single_ended Project

 

Now that the file has been identified, it needs to be linked to the CCS project via the following steps:

  1. Go to the CCS project and right click on the project name to bring up the options menu for the project (Figure 4-3).
  2. Click "Add Files".
    GUID-20201218-CA0I-9RQD-NTXD-DGN9Q85F8VGD-low.jpg Figure 3-3 Add Files Option for CCS Project
  3. This will bring up the file browser, and as identified before, the uartstdio.c file needs to be added from the utils directory. Navigate to that directory and select that file.
    Tip: It is possible to select multiple files by holding CTRL down and clicking each one that must be linked.
  4. When adding the files, CCS will ask whether to copy or link the file(s). Select the ‘Link to files’ option (Figure 4-4). If adding another file from within the TivaWare SDK, it is also recommended to change the 'Create Link locations relative to:' path to 'SW_ROOT'. SW_ROOT is a TivaWare defined path for the base TivaWare SDK directory on the computer.
    GUID-20201218-CA0I-LWWP-2PH0-X8546WXFNW5F-low.jpg Figure 3-4 Recommended Link Location Path for Other TivaWare Files
Tip:

The SW_ROOT definition can be found in the CCS Project Properties under Resources → Linked Resources → Path Variables tab view.

 

Now the uartstdio.c file should show up in the file list for the project (Figure 4-5) and attempting to re-build the project will now be successful!

GUID-20201218-CA0I-LLNQ-VLMD-DDKBT6BPBGXT-low.jpg Figure 3-5 uartstdio.c Now Included in CCS Project

 

Another method to check if the process has been done correctly would be to go to the CCS Project Properties, navigate to the Resource → Linked Resources page and select the "Linked Resources" tab. Once there, look for the Variable Relative Location to be listed as seen in Figure 4-6.

GUID-20201218-CA0I-D5DG-KVPX-V6KNJDXWPG30-low.jpg Figure 3-6 Linked Resources within CCS Project Properties