From owner-freebsd-arm@freebsd.org Fri Feb 9 16:26:45 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99027F1059B for ; Fri, 9 Feb 2018 16:26:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 18E706B9F6 for ; Fri, 9 Feb 2018 16:26:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id C99A2F1059A; Fri, 9 Feb 2018 16:26:44 +0000 (UTC) Delivered-To: arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A50EDF10599 for ; Fri, 9 Feb 2018 16:26:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA136B9EF for ; Fri, 9 Feb 2018 16:26:43 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0173eea4-0db6-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 0173eea4-0db6-11e8-91c6-33ffc249f3e8; Fri, 09 Feb 2018 16:26:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w19GQcQA026988; Fri, 9 Feb 2018 09:26:38 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518193598.32585.138.camel@freebsd.org> Subject: Re: solved, was Re: serial on neopi neo From: Ian Lepore To: Daniel Braniss Cc: "freebsd-arm@freebsd.org" Date: Fri, 09 Feb 2018 09:26:38 -0700 In-Reply-To: References: <0291231B-F939-4EB9-BD20-AD32B8E768D2@cs.huji.ac.il> <421A858F-AC30-4BE5-8641-E7C8DDDA0493@cs.huji.ac.il> <1518191674.32585.136.camel@freebsd.org> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2018 16:26:45 -0000 On Fri, 2018-02-09 at 18:14 +0200, Daniel Braniss wrote: > > > > > On 9 Feb 2018, at 17:54, Ian Lepore wrote: > > > > On Fri, 2018-02-09 at 12:28 +0200, Daniel Braniss wrote: > > > > > > > > > > > > > > > > > > On 9 Feb 2018, at 12:02, Daniel Braniss > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > On 8 Feb 2018, at 17:30, Daniel Braniss > > > > > wrote: > > > > > > > > > > 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) > > > > > > > > > > any ideas? > > > > I have! > > > > > > > > I’m using the ‘what i thought’ unused pins (CTS/RTS) to drive > > > > some > > > > leds! > > > > > > > > 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! > > > > > > doing a cfmakeraw(3) is what screwed me up! > > > now all is ok! > > 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: > > > >     tcgetattr(fd, &t); > >     cfmakeraw(&t); > >     t.c_iflag &= ~(IXON | IXOFF | IXANY); > >     t.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS); > >     t.c_cflag |= CLOCAL | CREAD | CS8; > >     cfsetspeed(&t, whatever); > >     tcwriteattr(fd, TCSANOW, &t); > > > > -- 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 = CS8 | CLOCAL | CREAD; > t.c_iflag = IGNPAR; > cfsetspeed(…) > tcsetattr(fd, TCSANOW, &t); > > actually it was the tcgetattr and not really the cfmakeraw :-) > > danny > Without the makeraw you're going to get canonicalized input processing, maybe not what you want/need. -- Ian