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.

[CC2650] [ UART] [LINUX] How to display things onto the terminal

Hey everyone !

I have my application, with work perfectly, based on few sensortags. Now i want a sensortag to be in debug mode, with printf everywhere (i already made the "debug firware") link onto the Rpi (but could be any linux based computer).

I just want my linux ((actually, raspbian) to read the serial port and to save it in a txt file.

How can i do that. I tried, i was not even able to detect witch serial port was used...


EDIT : I tried

cat /dev/ttyS* 

-> no port worked  (just in case it is useful, i have ttyS0 to ttyS31)

Then i tried :

lsusb

output :

Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0bda:5727 Realtek Semiconductor Corp. 
Bus 002 Device 002: ID 17ef:6022 Lenovo 
Bus 002 Device 007: ID 0451:bef3 Texas Instruments, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

then

sudo modprobe usbserial vendor=0x0451 product=0xbef3

Now it is enabled onto /dev/ttyUSB1, but it still does not work, neither putty, nor the 

cat /dev/ttyUSB1

reads something (but the link is opened without errors)

  • Hello,

    I would suggest confirming your setup on a PC using one of the UART echo examples on the BLE Wiki. Once you know you are actually sending data to the port form the CC26xx, then you can debug your linux setup.

    Best wishes
  • Actually, my application works fine on teraterm on my win8
  • Antoine,

    Moving your post to the Code Composer Studio forum as that team has more knowledge wrt debuggers and drivers.

    Regards,
    Svend
  • Once again, if ound the answer by myself...

    Actually the serial port on linux aren't /dev/ttyS<didigt> the ports are on /dev/serial/by-id

    And i'm kind enougth to share my code :

    #include <stdio.h>
    #include <termios.h>
    #include <sys/fcntl.h>
    
    int main(void)
    {
    	int		fd;
    	char		c;
    	struct termios	termios_p;
    
    	/*Opening serial */
    	if ( (fd=open("/dev/serial/by-id/usb-Texas_Instruments_XDS110__02.02.04.01__with_CMSIS-DAP_00000000-if00",O_RDWR)) == -1 ) {
    		perror("open");
    		return -1;
    	}
    
    	/* Currents parameters reading*/
    	tcgetattr(fd,&termios_p);
    
    	/* don't care about BREAKs char */
    	termios_p.c_iflag = IGNBRK;
    
    	/* No partiular output mode (we're just reading) */
    	termios_p.c_oflag = 0;
    
    	/* 115200/8/n/1 */
    	termios_p.c_cflag = B115200 | CS8  ;
    
    	/* Non canonic mode but with echo activated */
    	termios_p.c_lflag = ECHO;
    
    	/* Immediatly available char */
    	termios_p.c_cc[VMIN] = 1;
    	termios_p.c_cc[VTIME] = 0;
    
    	/* Saving new digits */
    	tcsetattr(fd,TCSANOW,&termios_p);
    
    	/*Displaying */
    	printf("Ctrl + C to quit\n");
    
    	/* reading loop */
    	while ( 1 ) {
    		read(fd,&c,1);
    		if ( c == 0x03 )/* Ctrl-C */
    			break;
    		printf(" -%c-\n",c);
    	}
    
    	/* closing */
    	close(fd);
    
    	/* Bye...*/
    
            printf("I'll miss you, user... \n",c);
    
            return 0;
     }
    
    
    

  • if the sensortag is connected to Debugger Devpack, ls -l /dev/ttyACM* should be listed the connected devices.
    so "cat /dev/ttyACM0" is also running.