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.

AM3358使用TI的SDK来操作串口 不能正常工作

Other Parts Discussed in Thread: AM3358

       您好,我使用的SDK是ti-processor-sdk-linux-am335x-evm-04.02.00.09-Linux-x86-Install.bin ,使用make all生成的系统镜像,然后按照Linux的文件读写的方式来操作ttyS1,但是有多个函数会返回错误值。串口操作程序和很多资料的比对过,没发现什么异常。

       请问,AM3358的SDK使用uart1,在编译时需要什么配置吗?还是在程序里需要特殊设置? 能否给一份参考程序?非常感谢各位的解答!

 

下面是我的部分程序(到了tcgetattr();函数就返回错误值了,之后的函数也有返回错误值):

if((fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY)) == -1)
{
  printf("Open /dev/ttyS1 error.\n");
  exit(1);
}

tcgetattr(fd, &options);