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.

problem including I2C.h



Shifting from Eclipse To CCS

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 I2C.h...Do Help me out?

I am getting following errors:

..

"..\i2c.h", line 284: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 285: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 286: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 286: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 287: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 288: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 288: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 289: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 290: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 290: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 291: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 291: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 292: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 292: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 293: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 294: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 294: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 295: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 295: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 296: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 297: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 298: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 299: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 299: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 300: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 301: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 302: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 302: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 303: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 304: error #20: identifier "bool" is undefined
"..\i2c.h", line 304: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 305: error #20: identifier "bool" is undefined
"..\i2c.h", line 305: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 306: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 306: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 307: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 307: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 308: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 308: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 309: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 310: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 311: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 311: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 312: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 312: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 313: error #20: identifier "bool" is undefined
"..\i2c.h", line 314: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 315: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 316: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 317: error #20: identifier "bool" is undefined
"..\i2c.h", line 317: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 317: error #20: identifier "bool" is undefined
"..\i2c.h", line 318: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 319: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 320: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 321: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 322: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 322: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 323: error #20: identifier "bool" is undefined
"..\i2c.h", line 324: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 325: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 326: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 326: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 327: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 327: error #20: identifier "bool" is undefined
"..\i2c.h", line 328: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 328: error #20: identifier "bool" is undefined
"..\i2c.h", line 329: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 329: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 330: error #20: identifier "uint32_t" is undefined

>> Compilation failure
"..\i2c.h", line 331: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 332: error #20: identifier "bool" is undefined
"..\i2c.h", line 333: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 333: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 334: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 334: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 335: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 336: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 337: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 337: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 338: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 338: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 339: error #20: identifier "uint8_t" is undefined
"..\i2c.h", line 340: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 341: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 342: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 343: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 343: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 344: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 345: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 346: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 346: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 347: error #20: identifier "bool" is undefined
"..\i2c.h", line 347: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 347: error #20: identifier "bool" is undefined
"..\i2c.h", line 348: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 348: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 349: error #20: identifier "bool" is undefined
"..\i2c.h", line 350: error #20: identifier "uint32_t" is undefined
"..\i2c.h", line 350: error #20: identifier "uint32_t" is undefined
Error limit reached.

  • Hello Mahavir,

    Please add the following headers to your main code

    #include <stdint.h>
    #include <stdbool.h>

    Regards
    Amit
  • Hi,
    Sir ,As you suggested I have include following files...
    #include <stdint.h>
    #include <stdbool.h>
    But still I am getting following errors..
    "../main.c", line 46: warning #225-D: function declared implicitly
    "../main.c", line 61: error #20: identifier "GPIO_PB2_I2C0SCL" is undefined
    "../main.c", line 62: error #20: identifier "GPIO_PB3_I2C0SDA" is undefined
    "../main.c", line 65: error #20: identifier "I2C0_MASTER_BASE" is undefined
  • Hello Mahavir,

    Please look at one of the example codes or search for the defines in the driverlib and inc directory. The header file where they will be found is what you need to include as well. In this case

    inc/hw_memmap.h
    driverlib/pin_map.h

    Regards
    Amit
  • Thank you ,
    For your reply!
    I have included the above two mentioned files,but the errors are not going away(same errors as stated above).Actually I am not exactly including the header files ,instead of that I am using drag and drop method to add files in current project.???????Following is the present status of my ccs.

  • Hello Mahavir,

    Can you paste the compilation log of the main.c in the post.

    Secondly are the files added as a symbolic link?

    Regards
    Amit
  • Hi,Sir

    Following is compilation log of my code:::

    **** 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 ****



    , and regarding the files as I mentioned earlier I have moved(copied ) all the libraries from the respective library folders into the project just by dragging it and then droppping it.

    With Regards,
    Mahavir Dwivedi
  • Hi Amit Sir,

    Thanks for your reply ,

    After making the changes recommended by you as well as by the ccs forum ,previous errors have been removed.But ,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 **

  • Hello Mahavir,

    You would need to compile the uartstdio.c as well. Again drag and drop the file.

    Another suggestion would be to import one of the existing TivaWare examples like uart_echo and then updating the main file with your code, That will help get rid of unwanted setup issues.

    Regards
    Amit
  • hello sir,

    As suggested by you I have replaced my main code with the "hello World" code given in the examples.But errors are back.

    What should I do next?

    I have just copied the hello world code into the existing main code.No other changes have been made,,,

    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 ****

  • Hello Mahavir,

    I think you have misread me...

    Amit Ashara said:
    Another suggestion would be to import one of the existing TivaWare examples like uart_echo and then updating the main file with your code, That will help get rid of unwanted setup issues.


    The suggestion was to import an existing project and copy your code into the project's main code, not the other way around...

    Regards
    Amit