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.

Linux/BEAGLEBK: unable to compile linux system based header files compile in ccs , but able to compile in beagle bone root directory which include am335x sdk (5.0.02) using gcc compiler .

Part Number: BEAGLEBK

Tool/software: Linux

unable to compile linux header files  based header files compile in ccs , but able to compile in beagle bone root directory which include am335x sdk (5.0.02).

for example :

#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <stdio.h>


int fd; /* port file descriptor */
char port[20] = "/dev/ttyS1"; /* port to connect to */
speed_t baud = B9600; /* baud rate */
int i = 0;
int main(){

printf("opening port ");
fd = open(port, O_RDWR); /* connect to port */

......}

the above  code unable to compile in ccs . 

/opt/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/termios.h:4:10: fatal error: sys/termios.h: No such file or directory.

but able to compile in directory of beagle bone which has am335x sdk version and linux version-- linux-4.1.18+.

compl steps : gcc main.c -o main.o ---> ./main.o

  • Manoj,

    These instructions are a bit out of date, but the overall process is the same with newer SDKs and versions of CCS:

    processors.wiki.ti.com/.../Processor_SDK_Linux_Training:_Hands_on_with_the_Linux_SDK

    Can you please refer to this and see if it provides what you need to be able to build? Thanks.
  • unable to compile below code in ccs . giving a error .

    /opt/ti/ccs900/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/termios.h:4:10: fatal error: sys/termios.h: No such file or directory.

    but same code i copied to beagle bone root directory and able to compile and execute . in beaglebone booted the linux using sd card of ti-am335x sdk .




    #include <fcntl.h>
    #include <termios.h>
    #include <unistd.h>
    #include <stdio.h>


    int fd; /* port file descriptor */
    char port[20] = "/dev/ttyS1"; /* port to connect to */
    speed_t baud = B9600; /* baud rate */
    int i = 0;
    int main(){

    printf("opening port ");
    fd = open(port, O_RDWR); /* connect to port */

    /* set the other settings (in this case, 9600 8N1) */
    struct termios settings;
    tcgetattr(fd, &settings);

    cfsetospeed(&settings, baud); /* baud rate */
    cfsetispeed(&settings, baud);
    settings.c_cflag &= ~PARENB; /* no parity */
    settings.c_cflag &= ~CSTOPB; /* 1 stop bit */
    settings.c_cflag &= ~CSIZE;
    settings.c_cflag |= CS8 | CLOCAL; /* 8 bits */
    settings.c_lflag = ICANON; /* canonical mode */
    settings.c_oflag &= ~OPOST; /* raw output */

    tcsetattr(fd, TCSANOW, &settings); /* apply the settings */
    tcflush(fd, TCOFLUSH);

    /* — code to use the port here — */

    char buff[3]={0x00, 0x00, '\n'};
    while(i< 20){
    printf("forwarding message");

    write(fd,"BBDATA\n",7);
    // read(fd,&buff,sizeof(buff));
    printf("message : %s \n", &buff);
    i++;
    }

    close(fd); /* cleanup */
    }
  • Manoj,

    You just repeated your first post without any additional information. Did you follow the guide and configure a CCS project per it's recommendations? It doesn't seem so as it is not using the Cross Compile Toolchain that needs to be used to build this code.