Part Number: CC2652R7
Hi team,
we are trying to log uart data by using putty terminal in that we are facing some data logging format issue while saving in text file but in putty terminal data format is correct
I have attached the UART configuration and screen capture of putty terminal and text file (data format issue) for you reference. Please help us regarding this
/********************uart code*******************************/
UART_Handle uart;
UART_Params uartParams;
UART_init();
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;//UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.baudRate = 9600;
uartParams.dataLength = UART_LEN_8;
uartParams.readEcho = UART_ECHO_OFF;
uart = UART_open(CONFIG_UART_0, &uartParams);
if (uart == NULL) {
while (1);
}
We have initialized buffers as below
unsigned char recBuf[2005];
char buffer[80];
/*logic to write data to UART*/
for(i=5,j=0;i<2005;i++,j++)
{
sprintf(buffer,"%x",recBuf[i]);
UART_write(uart,&buffer, sizeof(buffer));
}
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2022.04.12 18:38:52 =~=~=~=~=~=~=~=~=~=~=~=
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0