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;
}