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.

Unresolved symbol CPUwfi/IntEnable/IntDisable

Other Parts Discussed in Thread: TM4C123GH6PM

Hey at all,

i tried to programm an UART connection to my TM4C123GXL.

When i try to debug, I get some unresolved symbol remain errors. I fixed them by importing some .c files. Unfortunately this generates three other errors:

unresolved symbol CPUwfi ; in sysctl.obj (sysctl.cis added)

Sometimes the following errors didn´t show off, i don´t know why they appear and disappear without any changes:

unresolved symbol IntEnable

unresolved symbol IntDisable.

This is my Code:

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"

#define GPIO_PA0_U0RX GPIO_PIN_0
#define GPIO_PA1_U0TX GPIO_PIN_1


int main(void) {
    
    char cThisChar;

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

     SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
     SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

     GPIOPinConfigure(GPIO_PA0_U0RX);
     GPIOPinConfigure(GPIO_PA1_U0TX);

     GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

     UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |UART_CONFIG_PAR_NONE));

     UARTCharPut(UART0_BASE, '!');

     do
        {
            //
            // Read a character using the blocking read function.  This function
            // will not return until a character is available.
            //
            cThisChar = UARTCharGet(UART0_BASE);

            //
            // Write the same character using the blocking write function.  This
            // function will not return until there was space in the FIFO and
            // the character is written.
            //
            UARTCharPut(UART0_BASE, cThisChar);
        }
        while((cThisChar != '\n') && (cThisChar != '\r'));

        //
        // Put a character to show the end of the example.  This will display on
        // the terminal.
        //
        UARTCharPut(UART0_BASE, '@');

        //
        // Return no errors
        //

    return 0;
}


Can anyone help me, please?

  • this is the text of the build console:
    **** Build of configuration Debug for project UARTTest ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building target: UARTTest.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=512 -m"UARTTest.map" --heap_size=0 -i"C:/ti/ccsv5/tools/compiler/arm_5.0.4/lib" -i"C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="UARTTest_linkInfo.xml" --rom_model -o "UARTTest.out" "./uart.obj" "./sysctl.obj" "./main.obj" "./gpio.obj" -l"libc.a" "../tm4c123gh6pm.cmd"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    CPUwfi ./sysctl.obj

    >> Compilation failure
    IntDisable ./uart.obj
    IntEnable ./uart.obj
    IntRegister ./uart.obj
    IntUnregister ./uart.obj
    SysCtlDelay ./sysctl.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "UARTTest.out" not built
    gmake: *** [UARTTest.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****
  • Hello Christian,

    In CCS you would need to add the driverlib.lib which contains the code for the failing functions. There is no need to import the .c files from the driverlib.

    It would be simpler if you can import an existing example and then overwrite it with your code.

    Regards
    Amit
  • Hi Amit,

    i tried to add the driverlib.lib in two ways. First I right clicked at my project an choose add file and copy driverlib.lib. Second i inserted it in properties->arm linker->include library file. But both ways are generating 43 new errors:


    **** Build of configuration Debug for project UARTTest ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building target: UARTTest.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=512 -m"UARTTest.map" --heap_size=0 -i"C:/ti/ccsv5/tools/compiler/arm_5.0.4/lib" -i"C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="UARTTest_linkInfo.xml" --rom_model -o "UARTTest.out" "./uart.obj" "./sysctl.obj" "./main.obj" "./gpio.obj" -l"libc.a" "../driverlib.lib" "../tm4c123gh6pm.cmd"
    <Linking>
    error #10056: symbol "ui32OscSelect" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlGPIOAHBEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntRegister" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlFlashSizeGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralDeepSleepEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralPresent" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlADCSpeedGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlDeepSleepClockSet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlClockSet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralClockGating" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntStatus" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntClear" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlResetCauseGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPWMClockGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlMOSCConfigSet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "ui32RSClkConfig" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralPowerOff" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlDeepSleep" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "ui32Osc" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralPowerOn" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralDeepSleepDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralSleepDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlReset" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlGPIOAHBDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlADCSpeedSet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlSRAMSizeGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "bNewPLL" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlClockGet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "ui32SysDiv" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPWMClockSet" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlUSBPLLEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"

    >> Compilation failure
    error #10056: symbol "SysCtlPeripheralSleepEnable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlIntUnregister" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlUSBPLLDisable" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralReady" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPIOSCCalibrate" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlResetCauseClear" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10056: symbol "SysCtlPeripheralReset" redefined: first defined in "./sysctl.obj"; redefined in "../driverlib.lib<sysctl.obj>"
    error #10010: errors encountered during linking; "UARTTest.out" not built
    gmake: *** [UARTTest.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Regards,
    Christian
  • I don´t want to overwrite an existing example because this should just be an warm up programm for an more complex program and in future i don´t want to search an example to overwrite if i want to write an program.
  • Hello Christian,

    Please use the option "Rebuild All" instead of Build. Also do remove the imported copy of the driverlib files.

    Regards
    Amit
  • Hi Amit,

    i removed all by myself imported .c files and used rebuild project. Now it works :)
    Thank you.

    Regards,
    Christian
  • One more thing. I debug the program and click resume to start the program on my mikrocontroller. This should be a simple program to test the UART programming. I connect the board via PuTTy, pushed enter but there is nothing shown in the console.

    Here is my actual code:

    /*
     * main.c
     */
    
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    #include "utils/cmdline.h"
    
    #define GPIO_PA0_U0RX GPIO_PIN_0
    #define GPIO_PA1_U0TX GPIO_PIN_1
    
    
    int main(void) {
        
        char cThisChar;
    
        SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
    
         SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
         SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
         GPIOPinConfigure(GPIO_PA0_U0RX);
         GPIOPinConfigure(GPIO_PA1_U0TX);
    
         GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
         UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |UART_CONFIG_PAR_NONE));
    
         UARTEnable(UART0_BASE);
    
    
    
         UARTCharPut(UART0_BASE, '!');
    
         do
            {
                //
                // Read a character using the blocking read function.  This function
                // will not return until a character is available.
                //
                cThisChar = UARTCharGet(UART0_BASE);
    
                //
                // Write the same character using the blocking write function.  This
                // function will not return until there was space in the FIFO and
                // the character is written.
                //
                UARTCharPut(UART0_BASE, cThisChar);
            }
            while((cThisChar != '\n') && (cThisChar != '\r'));
    
            //
            // Put a character to show the end of the example.  This will display on
            // the terminal.
            //
            UARTCharPut(UART0_BASE, '@');
    
            //
            // Return no errors
            //
    
        return 0;
    }
    


    Maybe the problem is after debug, it is shown in the picture above.

    Is there any fault in my code why the communication does not work ?



    regards

  • Hello Christian,

    The error message shown in the second pic is OK as you are using the pre compiled version of driverlib.lib.

    On the issue of nothing showing in PuTTy, is the first print of "!" coming? Also is the PuTTy connected on the same COM port as shown in the Device Manager in PC and the Baud Rate same as that what you have set in the TM4C123 device

    Can you please share your project.

    Regards
    Amit
  • Hi Amit,

    no there is nothing shown. The COM Port is the right one. I choose the same configuration as in the rgb example project.

    How can I share my project with you ?


    regards

  • Hello Christian

    When replying to the post "use rich formatting" in the bottom right corner. Then drag and drop the CCS project zip file

    Regards
    Amit
  • Hello Christian

    There were a lot of compilation errors. I could get some of them sorted, but not all. However a quick check of the errors led to the following

    1. You are using a old version of TivaWare. Please update to 2.1.0-12573 (it is there on the TI web site)
    2. You have defined the GPIO_PA1_U0TX as GPIO_PIN_2 which is not the correct define. The defines must be from the TivaWare pin_map.h file for which the following two defines are required TARGET_IS_TM4C123_RB1 and PART_TM4C123GH6PM. You would need to add it to the compilation flow.

    Also the code that came in does not look like the original code post. The utils driver files require the uartstdio.c and cmdline.c to be linked to the project. The first one was but not the second one.

    Regards
    Amit
  • can you send me a link to the update ?

    If I just add

    #define TARGET_IS_TM4C123_RB1

    #define PART_TM4C123GH6PM

    the GPIO_PA0_U0RX and GPIO_PA1_U0TX are undefined.

    2337.UARTTest.zip

  • Hello Christian,

    Too many corrections to be made.... Attached the final working project. Please check the content of the project to yours.

    4452.UARTTest.zip

    Regards

    Amit

  • Thank you for this project.
    Can you explain me why you set [1] and [0] behind the cThisChar ?
    But when I start the connection there shows no "!" up. if I press enter the Bad Command is shown as expected. If I try further inputs, it only works with the numbers of my numberfield on the rigth of the keyboard and I have to disable the Num caption. Then the programm detects an input, but it is always the same.

    I think there is an further problem. My final goal is to read an integer variable and store the value in an variable in my programm with witch I can do some calculations.

    I am sorry for my tiny knowledge and want to thank you for your help!

    regards

  • Hello Christian,

    There were a lot of compilation errors in the beginning (so began a clean up and simplification of the code). Make sure that PuTTy is started before the program execution for "!" is put out. I had the issue so did a reset of the launchpad.

    Anyways, the code has started working for you, so I believe you should be able to play with it to understand more... One way is to send the characters like -1 and see how the CPU stores it to be able to make signed/unsigned decision.

    Regards
    Amit
  • But the sending of the character does not work. how I tried to explain you in my last reply the console does not act when I type a number on my keyboard. Only if I type one of the F keys (F1...F12). Then the program stores 1 in my variable.

    regards
    christian
  • Hello Chrsitian,

    That is strange. I just tried with Num Lock "ON" and "OFF" and the keypad detects 0-9 being typed on it and prints it back to the UART console

    Regards
    Amit
  • Hello Amit,

    the problem stayed, only F keys if I use an array of char...[ ]. If I use char* instead of char...[ ] the console get the rigth keys. Sadly I can only input three numbers. A further problem is the output is constant 0.

    I can´t believe that it is so complicated to read a number and print it out.

    Here is the modified project.

    Regards,

    Christian

    UART_Test.zip

  • Hello Christian

    1. Changed char* input to char input[40];
    2. Changed the while loop
    while(1){

    UARTprintf("\n TM4C !\n");
    UARTprintf("Input please:\n");


    UARTgets(input, sizeof(input));

    UARTprintf("Your input is :%s",input);
    }

    3, And added the startup_ccs.c to your project (file is missing and sadly after a reset w/o this file the project does not work).

    After doing 1-2-3, all is OK

    Regards
    Amit
  • I didn´t had to import the startup_ccs.c. If I did there were other unresolved symbol.

    Now it works. Thank you very much.

    Regards,

    christian

  • Hello Christian

    Without the startup_ccs.c the device would not work after a POR or a System reset

    Regards
    Amit
  • hmm ok. How to fix then the SysTickIntHandler unresolved symbol error when I import the startup_ccs.c file?
    I tried to import the systick.c file as well but that generates only more errors.

    regards
  • Hello Christian

    If you are not using the SysTickIntHandler then remove the line called extern and in the interrupt vector table replace it with the default Interrupt Handler

    Regards
    Amit
  • I removed it in the startup_ccs.c file the SysTickIntHandler, then the errors USB0DeviceIntHandler and USBUARTIntHandler unresolved symbol shows up. If I eliminate them in the extern line and in the table it works. Did I remove then some important functions of the startup_ccs.c ?

    regards
  • Hello Christian,

    No you did not. If you are not using the Interrupt Handler (that you have removed), then they should not be there in the first place.

    Regards
    Amit
  • Ok thank you once more.
    regards,
    christian