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.

CC2642R: uart communication

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG, CC2652R

Tool/software:

Hello,

I am trying to recieve data through uart using the ti driver uart2calback (before to integrate it to sensor example):
I have linked a common gnd and both rx-tx between the second board (beagleboneblack) and the ti board , but i still can not recieve the data coming from the beagleboneblack. 
The ti driver only echoes back what comes from the console 
how to deal with as i have configured both boards with same parameters : baudrate 115200 ,1 stop bit , data length 8 ,parity none
(I am using hercules as utility for display )
Thanks in advance & Best regards !  
This is the code running on beaglebone black :

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

#include <fcntl.h>

#include <termios.h>

#include <string.h>

void*mainThread(void* arg0) {

printf("ok1 \n");

int uart1_filestream = -1;

printf("ok2 \n");

uart1_filestream = open("/dev/ttyO1", O_RDWR | O_NOCTTY); // Retiré O_NDELAY pour bloquer si nécessaire

printf("ok3 \n");

if (uart1_filestream == -1) {

printf("NOT ok4 \n");

perror("Erreur - Impossible d'ouvrir le port UART1.");

return (void*)-1;

}

// Configurer UART1

struct termios uart1;

tcgetattr(uart1_filestream, &uart1);

printf("ok5 \n");

uart1.c_cflag = B115200| CS8 | CLOCAL | CREAD;

uart1.c_iflag = IGNPAR | ICRNL;

uart1.c_cflag &= ~CSTOPB;

uart1.c_cflag &= ~PARENB;

printf("ok6 \n");

tcflush(uart1_filestream, TCIFLUSH);

tcsetattr(uart1_filestream, TCSANOW, &uart1);

printf("ok7 \n");

unsigned char tx_buffer[] = "Hello\n";

printf("ok8 \n");

while(1){

sleep(1);

if (write(uart1_filestream,(const void*) tx_buffer, sizeof(tx_buffer)) < 0) {

printf("NOT ok9 \n");

perror("Erreur - Échec de l'écriture sur l'UART1.");

return(void*) -1;

}

printf("ok10 \n");

}

return 0;

}



  • Hello salma,

    Are you using a TI LaunchPad or a custom hardware design for the CC2642R?  I would recommend using a PC tool like PuTTY or TeraTerm to confirm that the uart2calback is operating as intended.  You should then check the UART RX/TX, VCC, and GND connections to make sure that all devices are operational.  Are you using the default UART RX/TX pin designations from the uart2callback example or have you changed them in SysConfig before re-programming the board?  I cannot offer any advice as to your BBB code, however if you connect an oscilloscope or logic analyzer to the UART RX/TX lines then you will know more about the actual communication taking place.  It would also be helpful if you can establish a JTAG connection to the CC2642R so that you can debug the firmware.

    Regards,
    Ryan

  • Hello!
    I am using a ti launchpad even for putty or realterm the callback example echoes back what is coming from the console but when i use to send data from an other board it doesnt echo it back although the other board echoes back what i send from the ti launchpad 
    I wanted to be sure if the uart drivers from the resource explorer are designed only to echo back to console ?
    ps : i am sure about rx_tx pins linking & gnd (no need for vcc because they are powered up separately)
    Thanks in advance!

  • The UART2 TI Drivers support any valid UART compatible device.  You should make sure that your BBB UART settings are consistent with the CC2652R implementation: baud rate 115200, 8 data bits, 1 stop bit, no parity bit, no flow control by default.

    Regards,
    Ryan