Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Feb 2019 17:16:17 +1100
From:      Brian Scott <bscott@bunyatech.com.au>
To:        freebsd-arm@freebsd.org
Subject:   Serial Port on RPi3
Message-ID:  <75aa4f8f-1c93-0cc0-b3ed-0208c40098be@bunyatech.com.au>

next in thread | raw e-mail | index | archive | help
Hi,

Has anyone had any success using the serial port on a Raspberry Pi 3 at
anything other than 115200?

I'm trying to connect a GPS module to it (as most people do...) but am
having a lot of trouble.

To give myself some diagnostics I have connected another machine up
using an adafruit cable and a terminal program.

My first problem was u-boot. I have largely managed to get it out of the
way by setting the stdin, stdout and stderr environment variables to
usbkbd, vidconsole, and vidconsole (i.e. removing the serial option) but
it still insists on sending:

    MMC:   mmc@7e300000: 1
    Loading Environment from FAT... OK
    In:    serial
    Out:   vidconsole
    Err:   vidconsole

at 115200 baud before getting out of the way. No big deal because it
doesn't look like gps commands and it is being sent at much higher
speeds than I would expect the gps to understand anyway.

The message on boot for the UART is:

    uart0: <PrimeCell UART (PL011)> mem 0x7e201000-0x7e201fff irq 24 on
    simplebus0

If I send data to the uart (echo Hi >/dev/cuau0) it works but at 115200
baud, not respecting the stty speed of 9600. Similarly, using cu (cu -l
cuau0 -s 9600), I can send data but at 115200, not the expected 9600 baud.

I have done some experiments with enable_uart= in the config.txt as well
as overlays from the linux world (uart0.dtbo and uart1.dtbo). While I
can get FreeBSD to detect the Mini-UART with some combinations of
settings, either on it's own or with the PL011, I haven't been able to
get anything out of the mini-uart and only a single character out of the
PL011 (at 115200 baud despite other settings).

My conclusions so far:

  * There is no working driver behind the detection of the mini-uart.
  * There is no way to change the speed of the PL011 to anything other
    than 115200 (maybe because u-boot sets it that way at startup -
    haven't fiddled with those knobs yet).

Am I missing something important somewhere?

Cheers,

Brian

P.S. I'm running 12-RELEASE with no software changes.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?75aa4f8f-1c93-0cc0-b3ed-0208c40098be>