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.

Shifting from Eclipse To CCS

Other Parts Discussed in Thread: TM4C123GH6PM, EK-TM4C123GXL

Hi,

I am trying to shift from eclipse ide to ccs.

The problem which I am facing is regarding the libraries,when I am running the following program in eclipse I am not getting any error but in case of ccs I am getting errors related to gpio.h...Do Help me out?

I am getting following errors:

..\i2c.h", line 139: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 140: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 148: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 152: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 152: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 158: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 162: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 163: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 167: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 182: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 182: error #20: identifier "tBoolean" is undefined
"..\i2c.h", line 184: error #20: identifier "tBoolean" is undefined
"../main.c", line 27: fatal error #5: could not open source file "sysctl.h"

  • mahavir dwivedi said:
    The problem which I am facing is regarding the libraries,when I am running the following program in eclipse I am not getting any error but in case of ccs I am getting errors related to gpio.h

    I presume when building in Eclipse you are not using the TI compiler, but when building with CCS you are?

    You have provided very little information here for us to be able to provide any concrete answers. If you are working with a TI device/board it is recommended to start with example projects that are provided for almost all devices so you have a good starting point with projects that already build.

    mahavir dwivedi said:
    "../main.c", line 27: fatal error #5: could not open source file "sysctl.h"

    These types of errors occur when the compiler is unable to locate and open the file. For header files, this usually means you need to add the path to the header file within the compiler's --include_path option, which you can get to in CCS by going to Project Properties->Build->Compiler->Include Options.

  • Hello @AartiG

    Thank You For your reply!

    Sorry ,for not providing complete information.

    I am using Tm4C MIcrocontroller board .

    1.As you recommended to start with examples, I had successfully implemented them earlier.They are working properly .

    2.Yes, I do agree with you that the problem is with the header files but I am not able to figure it out.

    3.I have added the libraries by just dragging them from their respective folders and dropping them into the project window,Is there a problem with this approach,

    4.The present status of my project is following,I am getting three errors..

    5.Compilation log is following:

    **** Build of configuration Debug for project lab2 ****

     

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all

    'Building file: ../main.c'

    'Invoking: ARM Compiler'

    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"

    "../main.c", line 48: warning #225-D: function declared implicitly

    "../main.c", line 63: error #20: identifier "GPIO_PB2_I2C0SCL" is undefined

    "../main.c", line 64: error #20: identifier "GPIO_PB3_I2C0SDA" is undefined

    "../main.c", line 67: error #20: identifier "I2C0_MASTER_BASE" is undefined

    3 errors detected in the compilation of "../main.c".

     

    >> Compilation failure

    gmake: *** [main.obj] Error 1

    gmake: Target `all' not remade because of errors.

     

    **** Build Finished ****

     

     

  • mahavir dwivedi said:

    "../main.c", line 63: error #20: identifier "GPIO_PB2_I2C0SCL" is undefined

    "../main.c", line 64: error #20: identifier "GPIO_PB3_I2C0SDA" is undefined

    To get those definitions from pin_map.h there should be pre-defined symbol of the form PART_<device> defined. As your example appears to be for a TM4C123GH6PM device, then the pre-defined symbol PART_TM4C123GH6PM should be set under the CCS Project Properties -> CCS Build -> ARM Compiler -> Advanced Options -> Predefined symbols. E.g.:

    mahavir dwivedi said:
    "../main.c", line 67: error #20: identifier "I2C0_MASTER_BASE" is undefined

    I2C0_MASTER_BASE was used in StellarisWare, but is not defined in TivaWare. For TivaWare change to use I2C0_BASE instead.

    [I found that in StellarisWare I2C0_MASTER_BASE has the value 0x40020000, and in TivaWare I2C0_BASE has the same value]

  • Hello @Chester Gillon,

    Thanks for your reply ,

    After making the changes recommended by you ,Now I am getting errors related to UART.

    Please do help me out..

    My present compilation log is...


    **** Build of configuration Debug for project lab2 ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib" --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=UART_BUFFERED --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
    "../main.c", line 48: warning #225-D: function declared implicitly
    'Finished building: ../main.c'
    ' '
    'Building target: lab2.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 --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=UART_BUFFERED --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=512 -m"lab2.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="lab2_linkInfo.xml" --rom_model -o "lab2.out" "./main.obj" -l"libc.a" "C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib/ccs/Debug/driverlib.lib" "../tm4c123gh6pm.cmd"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    UARTStdioInit ./main.obj
    UARTprintf ./main.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "lab2.out" not built

    >> Compilation failure
    gmake: *** [lab2.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    ,

    With Regards,

    Mahavir 

  • mahavir dwivedi said:
    UARTprintf ./main.obj

    The UARTprintf function is in the TivaWare utils/uartstdio.c source file - which needs to be added to your project.

    mahavir dwivedi said:
    UARTStdioInit ./main.obj

    The UARTStdioInit function was in the StellarisWare utils/uartstdio.c and set a default serial port and UART source clock frequency.

    UARTStdioInit doesn't exist in the TivaWare utils/uartstdio.c source file, so you need to modify the program to call UARTStdioConfig instead. Look at the TivaWare examples to see how UARTStdioConfig is used.

  • Hello @Chester Gillon,

    Thanks for your reply ,
    Can you specify which Uart example from which folder i should look into.It would be more helpful if you can provide me that particular example ,because as i tried few examples related to UART ,it gave me errors...
    With regards ,
    Mahavir
  • mahavir dwivedi said:
    Can you specify which Uart example from which folder i should look into.

    Have a look at examples/boards/ek-tm4c123gxl/hello

  • Hi,

    As you said I tried running the hello code but I am getting following errors,..my compilation log is following..


    **** Build of configuration Debug for project lab2 ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib" --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=UART_BUFFERED --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
    "../main.c", line 74: warning #225-D: function declared implicitly
    "../main.c", line 84: warning #225-D: function declared implicitly
    "../main.c", line 86: warning #225-D: function declared implicitly
    "../main.c", line 114: warning #225-D: function declared implicitly
    "../main.c", line 119: warning #225-D: function declared implicitly
    "../main.c", line 125: warning #225-D: function declared implicitly
    "../main.c", line 130: warning #225-D: function declared implicitly
    'Finished building: ../main.c'
    ' '
    'Building target: lab2.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 --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=UART_BUFFERED --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=512 -m"lab2.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="lab2_linkInfo.xml" --rom_model -o "lab2.out" "./main.obj" -l"libc.a" "C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib/ccs/Debug/driverlib.lib" "../tm4c123gh6pm.cmd"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    ROM_FPULazyStackingEnable ./main.obj
    ROM_GPIOPinConfigure ./main.obj
    ROM_GPIOPinTypeGPIOOutput ./main.obj
    ROM_GPIOPinTypeUART ./main.obj
    ROM_SysCtlClockSet ./main.obj
    ROM_SysCtlPeripheralEnable ./main.obj
    UARTStdioConfig ./main.obj
    UARTprintf ./main.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "lab2.out" not built

    >> Compilation failure
    gmake: *** [lab2.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • mahavir dwivedi said:
    ROM_FPULazyStackingEnable ./main.obj
    ROM_GPIOPinConfigure ./main.obj
    ROM_GPIOPinTypeGPIOOutput ./main.obj
    ROM_GPIOPinTypeUART ./main.obj
    ROM_SysCtlClockSet ./main.obj
     ROM_SysCtlPeripheralEnable ./main.obj

    Those undefined symbols are caused by not having a TARGET_<device_family>_<ROM_version> predefined symbol, which is used by the TivaWare rom.h include file to select the available functions in the Tiva ROM. To remove those undefined symbols add the predefined symbol TARGET_IS_TM4C123_RB1 to the compiler options.
    mahavir dwivedi said:
    UARTStdioConfig ./main.obj
    UARTprintf ./main.obj
    Those undefined symbols are caused by UARTStdio.c not being part of the project.

  • mahavir dwivedi said:
    **** Build of configuration Debug for project lab2 ****

    Import hello project to CCS. It should build without errors.

    - kel

  • Hi,
    As you said I imported the "hello code ",and made changes in it ,but I am again getting errors related to I2c...my compilation log is following...

    **** Build of configuration Debug for project hello ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building file: ../hello.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv5/tools/compiler/arm_5.0.4/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -O2 -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.4/include" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/inc" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/utils" --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --define=TARGET_IS_TM4C123_RB1 --diag_warning=225 --display_error_number --diag_wrap=off --gen_func_subsections=on --ual --preproc_with_compile --preproc_dependency="hello.pp" "../hello.c"
    "../hello.c", line 178: warning #225-D: function declared implicitly

    >> Compilation failure
    "../hello.c", line 179: warning #225-D: function declared implicitly
    "../hello.c", line 181: warning #225-D: function declared implicitly
    "../hello.c", line 182: warning #225-D: function declared implicitly
    "../hello.c", line 182: error #20: identifier "I2C_MASTER_CMD_BURST_SEND_START" is undefined
    "../hello.c", line 185: warning #225-D: function declared implicitly
    "../hello.c", line 188: error #20: identifier "I2C_MASTER_CMD_BURST_SEND_CONT" is undefined
    "../hello.c", line 213: error #20: identifier "I2C_MASTER_CMD_BURST_SEND_FINISH" is undefined
    "../hello.c", line 226: error #20: identifier "I2C_MASTER_CMD_BURST_RECEIVE_START" is undefined
    "../hello.c", line 228: warning #225-D: function declared implicitly
    "../hello.c", line 230: error #20: identifier "I2C_MASTER_CMD_BURST_RECEIVE_CONT" is undefined
    "../hello.c", line 255: error #20: identifier "I2C_MASTER_CMD_BURST_RECEIVE_FINISH" is undefined
    "../hello.c", line 282: error #171: expected a declaration
    7 errors detected in the compilation of "../hello.c".
    gmake: *** [hello.obj] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****
  • @mahavir

    You imported hello example program and it build without errors. Then you add I2C code and it build with errors. That means your added code caused it to have build errors.

    When you add I2C code you need to include in your main C file header files that are called by that I2C code.

    - kel