Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2013 12:29:55 +0300
From:      Aleksandr Rybalko <ray@freebsd.org>
To:        Tom Everett <tom@khubla.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: RS-232 driver for GPIO
Message-ID:  <20130515122955.4387631e9969ae460f6500c7@freebsd.org>
In-Reply-To: <CAB3ij4Ctq9j0svwqeUJk32Ugy6NJ1W7PJ9rrTue%2BtyDnky5g_Q@mail.gmail.com>
References:  <CAB3ij4AzL8B6nS1kFa%2BgjmAVEOE8qO7UwPv_vBzRPn1sUNYuDQ@mail.gmail.com> <CAJ-Vmo=ZzAOyy9hWzMDw7bt9=nxsEzyAJnScgL-3NFfzcf7RXA@mail.gmail.com> <20130514192448.7b48e095.ray@freebsd.org> <CAB3ij4DLEBe_R1ydVJ0T-V0-ufizMHERNnPuzO_DY8iOE=1kSQ@mail.gmail.com> <20130515021751.8848a996.ray@freebsd.org> <CAB3ij4Ctq9j0svwqeUJk32Ugy6NJ1W7PJ9rrTue%2BtyDnky5g_Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 14 May 2013 20:24:42 -0600
Tom Everett <tom@khubla.com> wrote:

> Did you mean 14 &15, or 14 & 16?
Yeah, right.


> ok so given this, I've done some reading.  I'm by no means a FreeBSD
> expert, so forgive me if I'm completely wrong.  I see this in the FDT:
> 
> /* UART0 */
> pins_uart0_a: uart0_a {
> 	broadcom,pins = <14>, <15>;
> 	broadcom,function = "ALT0";
> };

If you satisfied by single UART, you no need change that.


> 
> 
> and this:
> 
> chosen {
> 		bootargs = "";			/* Set by VideoCore */
> 		stdin = "uart0";
> 		stdout = "uart0";
> 	};
> 

But that stdin and stdout direct kernel console messages to air by your
xbee :)
So you need comment it or set different in/out device.


> 
> So I interpret that to mean that uart0 is bound to pins 14, 15, and
> furthermore that the serial device bound to uart0 is bound to stdin and
> stdout.  In my /dev/ I see:
> 
> crw-------   1 root  wheel     0x1f Apr 27 13:42 ttyu0
> crw-------   1 root  wheel     0x20 Apr 27 21:42 ttyu0.init
> crw-------   1 root  wheel     0x21 Apr 27 21:42 ttyu0.lock
> crw-rw----   1 uucp  dialer    0x22 Apr 27 21:42 cuau0
> crw-rw----   1 uucp  dialer    0x23 Apr 27 21:42 cuau0.init
> crw-rw----   1 uucp  dialer    0x24 Apr 27 21:42 cuau0.lock
> 
> So, that is telling me that sio0 is bound to uart0, which is a serial
> console?

Yep.

> 
> If so, that means that I could use pins 14 & 15 for rs-232, but I would
> have to chose b/t using those pins to talk to another device (xbee), or a
> serial console?

if you will disconnect serial console you will have to choose between
control over network (SSH/telnet/etc) or graphic console (Display with
HDMI + USB keyboard). 

> 
> 
> 
> 
> 
> On Tue, May 14, 2013 at 5:17 PM, Aleksandr Rybalko <ray@freebsd.org> wrote:
> 
> > On Tue, 14 May 2013 12:20:08 -0600
> > Tom Everett <tom@khubla.com> wrote:
> >
> > > ok so the FDT definition would have to be added here?
> > >
> > >
> > http://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/bcm2835-rpi-b.dts?view=markup
> > >
> >
> > Yeah, right.
> >
> > But I have bad news. Both UARTs can be connected to pairs(tx+rx) 14+16,
> > 32+33, 40+41 and both UARTs can be connected to any of this pins.
> > But only 14, 16 and 40(PWM0) wired to ext.pin.
> >
> > >
> > >
> > > On Tue, May 14, 2013 at 10:24 AM, Aleksandr Rybalko <ray@freebsd.org>
> > > wrote:
> > >
> > > > On Tue, 14 May 2013 09:06:44 -0700
> > > > Adrian Chadd <adrian@freebsd.org> wrote:
> > > >
> > > > > ... the r-pi actually has an RS232 port exposed via GPIO. It's
> > > > > only 3.3v but it's there.
> > > > >
> > > > > Someone just needs to write up an SIO driver for it and then put
> > > > > the GPIO pins in question into RS232 "mode".
> > > >
> > > > we have it already :) (console works on uart)
> > > > only FDT definition is required.
> > > > And maybe some fixes for boudrate setting and/or format setup
> > > > (bits/parity/stop bits/etc)
> > > >
> > > > >
> > > > > Yay multi-function GPIO pins!
> > > > >
> > > > >
> > > > >
> > > > > adrian
> > > > >
> > > > >
> > > > > On 14 May 2013 08:58, Tom Everett <tom@khubla.com> wrote:
> > > > > > Good morning ARM mailing list.
> > > > > >
> > > > > > I've been running FreeBSD on my Pi, and I've now got two XBee
> > > > > > Pros which I hope to connect.  XBee's communicate over RS-232.
> > > > > >
> > > > > > https://www.sparkfun.com/products/8742
> > > > > >
> > > > > > I see from the source tree that it was possible to attach the
> > > > > > iic driver to GPIO pins in software:
> > > > > >
> > > > > >
> > http://svnweb.freebsd.org/base/head/sys/dev/gpio/gpioiic.c?view=markup
> > > > > >
> > > > > > I'm wondering, it is possible to connect the FreeBSD serial
> > > > > > driver for RS-2332 to GPIO in a similar way to how iic was
> > > > > > connected?
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > A better world shall emerge based on faith and understanding  -
> > > > > > Douglas MacArthur
> > > > > > _______________________________________________
> > > > > > freebsd-arm@freebsd.org mailing list
> > > > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> > > > > > To unsubscribe, send any mail to
> > > > > > "freebsd-arm-unsubscribe@freebsd.org"
> > > > > _______________________________________________
> > > > > freebsd-arm@freebsd.org mailing list
> > > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> > > > > To unsubscribe, send any mail to
> > > > > "freebsd-arm-unsubscribe@freebsd.org"
> > > >
> > > >
> > > > --
> > > > Aleksandr Rybalko <ray@freebsd.org>
> > > >
> > >
> > >
> > >
> > > --
> > > A better world shall emerge based on faith and understanding  -
> > > Douglas MacArthur
> >
> >
> > --
> > Aleksandr Rybalko <ray@freebsd.org>
> >
> 
> 
> 
> -- 
> A better world shall emerge based on faith and understanding  - Douglas
> MacArthur

Good luck! And let us know how things is going :)

WBW
-- 
Aleksandr Rybalko <ray@freebsd.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130515122955.4387631e9969ae460f6500c7>