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/TM4C123GH6PM: Getting Error while building code on CCS V6 on UBUNTU

Part Number: TM4C123GH6PM


Tool/software: Code Composer Studio

I am using TM4C for the first time. I am trying to obtain data from ADXL335 accelerometer through the GPIO pins.
Here is my code:

#include <stdio.h>
int main(void) {
    int32_t i32val;
    GPIOPinTypeGPIOInput(GPIO_PORTB_BASE,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_5);
    GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_4);
    while(1)
    {
        GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_4,0);
        i32val = GPIOPinRead(GPIO_PORTB_BASE,GPIO_PIN_1);
        printf('%d',i32val);
    }
}



But I am getting the errors when I try to build the code:Compilation failure
subdir_rules.mk:7: recipe for target 'main.obj' failed
"../main.c", line 5: error #20: identifier "int32_t" is undefined
"../main.c", line 6: warning #225-D: function "GPIOPinTypeGPIOInput" declared implicitly
"../main.c", line 6: error #20: identifier "GPIO_PORTB_BASE" is undefined
"../main.c", line 6: error #20: identifier "GPIO_PIN_0" is undefined
"../main.c", line 6: error #20: identifier "GPIO_PIN_1" is undefined
"../main.c", line 6: error #20: identifier "GPIO_PIN_5" is undefined
"../main.c", line 7: warning #225-D: function "GPIOPinTypeGPIOOutput" declared implicitly
"../main.c", line 7: error #20: identifier "GPIO_PORTE_BASE" is undefined
"../main.c", line 7: error #20: identifier "GPIO_PIN_4" is undefined
"../main.c", line 10: warning #225-D: function "GPIOPinWrite" declared implicitly
"../main.c", line 11: warning #225-D: function "GPIOPinRead" declared implicitly
"../main.c", line 12: warning #1696-D: multicharacter character literal (potential portability problem)
"../main.c", line 12: warning #169-D: argument of type "int" is incompatible with parameter of type "const char *"
"../main.c", line 12: warning #154-D: conversion of nonzero integer to pointer
7 errors detected in the compilation of "../main.c".
gmake: *** [main.obj] Error 1
gmake: Target 'all' not remade because of errors.

There is no "driverlib" folder in the location where I installed CCS

Is there any fault in installing the CCS?

Please suggest correction in my code, if any required

  • Hello,

    Looks like you took some existing TiveWare code and copy&pasted it into your source file but did not include any of the required header files. Your errors are because you are referencing functions and definitions in your source without including any of the required header files. Assuming that you are indeed working with TivaWare, you would need to include the following header files:

    #include "inc/hw_types.h
    #include "driverlib/gpio.h"
    #include "inc/hw_memmap.h"

    the above files are located in the root directory of your TivaWare installation (you should add this path to your include search path). This should get you past the compiling stage but you will need to add the required libraries when linking. I suggest starting with the TivaWare documentation first before trying to progress further. Any additional questions should be posted in the TM4C forum. The experts there are most familiar with TivaWare and can help you along best.

    Thanks

    ki

  • I included "driverlib/gpio.h" but it says that it cannot oprn the source file "driverlib/gpio.h". What should I do?

    I can't even find the driverlib folder anywhere.

  • Siladittya Manna said:
    I included "driverlib/gpio.h" but it says that it cannot oprn the source file "driverlib/gpio.h". What should I do?

    It is because you are missing the include search path to that location (i.e. the root directory of your TivaWare installation).


    Siladittya Manna said:
    I can't even find the driverlib folder anywhere.

    Do you have TivaWare installed? It is in the root directory of TivaWare

    http://www.ti.com/tool/sw-tm4c

    Thanks

    ki