Tool/software: Linux
I am using AM5718 IDK EVM,and ti-processor-sdk-linux-am57xx-evm-05.03.00.07. No LCD is connected and jumper J51 is open.
I understand that RS485 (UART2) corresponds to "/dev/ttyS1".
When I try the code snippet given below, open is successful, but write fails.
code
-----------------------------------------------------------------
#define UART2_FILE_NAME "/dev/tty1"
char buf[512] = {0X41, 0x42, 0x43, 0x44, 0x45, 0x46};
if ((int_FPUart2 = open(UART2_FILE_NAME, O_RDWR)) < 0) {
printf("Failed to open uart2%s\n", UART2_FILE_NAME);
exit(1);
}
if( write(int_FPUart2, buf, 6)==6)
printf("Writing uart2 ok\n");
else
printf("Error Writing uart2\n");
------------------------------------------------------
if I try the command "stty -F /dev/ttyS1", I get the following error:
"stty: /dev/ttyS1: Input/output error"
What should I do to enable and write to UART2 in the EVM?