Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2018 18:14:42 +0200
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Ian Lepore <ian@freebsd.org>
Cc:        "freebsd-arm@freebsd.org" <arm@freebsd.org>
Subject:   Re: solved, was Re: serial on neopi neo
Message-ID:  <F5F9D109-7CDB-40B0-94C2-AA675ACDF834@cs.huji.ac.il>
In-Reply-To: <1518191674.32585.136.camel@freebsd.org>
References:  <0291231B-F939-4EB9-BD20-AD32B8E768D2@cs.huji.ac.il> <D092D702-D0C8-431F-A727-27674FF5E7AB@cs.huji.ac.il> <421A858F-AC30-4BE5-8641-E7C8DDDA0493@cs.huji.ac.il> <1518191674.32585.136.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 9 Feb 2018, at 17:54, Ian Lepore <ian@freebsd.org> wrote:
>=20
> On Fri, 2018-02-09 at 12:28 +0200, Daniel Braniss wrote:
>>=20
>>>=20
>>> On 9 Feb 2018, at 12:02, Daniel Braniss <danny@cs.huji.ac.il>
>>> wrote:
>>>=20
>>>=20
>>>=20
>>>>=20
>>>> On 8 Feb 2018, at 17:30, Daniel Braniss <danny@cs.huji.ac.il>
>>>> wrote:
>>>>=20
>>>> hi,
>>>> after fiddling with the dts file (with the help from Milo), I got
>>>> 2 serial ports to work(apart from the /dev/ttyu0),
>>>> but not together! ie, if i try each one individually all is ok,
>>>> but once I open both of them, only
>>>> /dev/ttyu1 works, /dev/ttyu2 hangs (i have yet to see if its the
>>>> output or input)
>>>>=20
>>>> any ideas?
>>> I have!
>>>=20
>>> I=E2=80=99m using the =E2=80=98what i thought=E2=80=99 unused pins =
(CTS/RTS) to drive some
>>> leds!
>>>=20
>>> I do set, via tcsetattr(3) to ignore these (ie no modem, no flow
>>> control) but it seems the driver is ignoring this.
>>> how can I tell the serial/uart to ignore them?
>> was sent out too early!
>>=20
>> doing a cfmakeraw(3) is what screwed me up!
>> now all is ok!
>=20
> That's strange, because I was about to reply to the prior mail
> suggesting you start with a cfmakeraw() before tcsetattr().  I always
> start with makeraw then set just the things I want, like:
>=20
>     tcgetattr(fd, &t);
>     cfmakeraw(&t);
>     t.c_iflag &=3D ~(IXON | IXOFF | IXANY);
>     t.c_cflag &=3D ~(PARENB | CSTOPB | CSIZE | CRTSCTS);
>     t.c_cflag |=3D CLOCAL | CREAD | CS8;
>     cfsetspeed(&t, whatever);
>     tcwriteattr(fd, TCSANOW, &t);
>=20
> -- Ian

thats what I had, but did not clear the CRTSCTS, so what I do now, =
without the tcgetattr, and just set what I need
	bzero(&t, sizeof(t));
	t.c_flag =3D CS8 | CLOCAL | CREAD;
	t.c_iflag =3D IGNPAR;
	cfsetspeed(=E2=80=A6)
	tcsetattr(fd, TCSANOW, &t);

actually it was the tcgetattr and not really the cfmakeraw :-)

danny




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F5F9D109-7CDB-40B0-94C2-AA675ACDF834>