Using the com port on the iMX53

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using the com port on the iMX53

跳至解决方案
13,502 次查看
leonardfairclot
Contributor II

Has anyone created an application that opens the com port and listens to incoming messages and sends a response?

I'm writing in C and I believe that the "stdio.h" should have everything I need.  When I try to open the port I get error messages.  It doesn't seem to like the parameters:

int portnum

portnum = open("dev/ttys0", O_RDWR | O_NOCITY | O_NDELAY);

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
12,884 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

If you are using ubuntu, you can use root account like this :

#sudo bash

Then input lucid .

weidong

在原帖中查看解决方案

0 项奖励
回复
26 回复数
1,997 次查看
leonardfairclot
Contributor II

So I should be using "ttymxc1"?

0 项奖励
回复
1,997 次查看
Yuri
NXP Employee
NXP Employee

At first - for development / debugging - the "ttymxc0" may be used (in order to avoid problems how
to implement hardware connection with "ttymxc1" on the QSB) 

0 项奖励
回复
1,997 次查看
leonardfairclot
Contributor II

Yuri

I'll try again on Sunday night, Mondya morning your time.

Thanks

Leonard

0 项奖励
回复
1,997 次查看
Yuri
NXP Employee
NXP Employee

Please use O_NOCTTY instead of O_NOCITY 

0 项奖励
回复
1,997 次查看
leonardfairclot
Contributor II

Hi Yuri

I have it compiling with a comport trying to open. I asked Sun and I'll

ask you as well, what port should I be trying to open? I'm trying to

open "/dev/ttymxc0" is this

correct? I also tried "/dev/ttymxc1".

Thanks

Leonard

0 项奖励
回复
1,996 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,Leonard,

     I have programed UART on i.mx51, I paster source code and Makefile here. you can refer to them.

Regards,

Weidong

0 项奖励
回复