rkanton
Posts: 9
Joined: Tue Apr 30, 2013 4:05 pm

Devices /dev/serial0 and /dev/serial1 are not being created

Sun May 15, 2016 11:27 am

I am running latest software as of 5/13/16:
- Linux rts1 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux running.
- Latest 5/13/16 release via: apt-get dist-upgrade

It appears that /lib/systemd/system/hciuart.service file now uses "serial1" instead of "ttyAMA0" in previous releases.
i.e.:
ExecStart=/usr/bin/hciattach /dev/serial1 bcm43xx 921600 noflow -

For whatever reason I have no /dev/serial1 (or /dev/serial0) created:
> ls /dev/serial*
ls: cannot access /dev/serial*: No such file or directory

Although I what to keep the bluetooth functionality on ttyAMA0 (and console on ttyS0) - I tried dtoverlay=pi3-miniuart-bt to see if that would result in the creation of /dev/serial1 and /dev/serial0 but it didn't.

dmesg with "dtoverlay=pi3-miniuart-bt", and enable_uart=1 (only relevant entries shown):
[ 0.080780] bcm2709: Mini UART enabled
[ 0.080840] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.080887] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.081073] Serial: AMBA PL011 UART driver
[ 0.081258] uart-pl011 3f201000.uart: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[ 0.269949] Console: switching to colour frame buffer device 100x30
[ 0.275631] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.279274] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 50000000) is a 16550
[ 1.872473] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 3.060143] uart-pl011 3f201000.uart: no DMA platform data
[ 4.110664] systemd[1]: Expecting device dev-ttyAMA0.device...


I enabled device tree debug. Here's the output for "dtoverlay=pi3-miniuart-bt"

002218.267: dtdebug: Opened overlay file 'overlays/pi3-miniuart-bt.dtbo'
002231.873: Loaded overlay 'pi3-miniuart-bt'
002231.935: dtdebug: Found fragment 0 (offset 36)
002236.219: dtdebug: merge_fragment(/soc/uart@7e201000,/fragment@0/__overlay__)
002236.247: dtdebug: +prop(pinctrl-names)
002237.713: dtdebug: +prop(pinctrl-0)
002239.174: dtdebug: +prop(status)
002240.629: dtdebug: merge_fragment() end
002240.691: dtdebug: Found fragment 1 (offset 148)
002246.927: dtdebug: merge_fragment(/soc/uart@7e215040,/fragment@1/__overlay__)
002246.954: dtdebug: +prop(pinctrl-names)
002248.203: dtdebug: +prop(pinctrl-0)
002249.463: dtdebug: +prop(status)
002250.708: dtdebug: merge_fragment() end
002250.770: dtdebug: Found fragment 2 (offset 264)
002254.781: dtdebug: merge_fragment(/soc/gpio@7e200000/uart0_pins,/fragment@2/__overlay__)
002254.807: dtdebug: +prop(brcm,pins)
002256.227: dtdebug: +prop(brcm,function)
002257.657: dtdebug: +prop(brcm,pull)
002259.103: dtdebug: merge_fragment() end
002259.165: dtdebug: Found fragment 3 (offset 356)
002263.336: dtdebug: merge_fragment(/soc/gpio@7e200000/uart1_pins,/fragment@3/__overlay__)
002263.361: dtdebug: +prop(brcm,pins)
002264.785: dtdebug: +prop(brcm,function)
002266.215: dtdebug: +prop(brcm,pull)
002267.652: dtdebug: merge_fragment() end
002267.713: dtdebug: Found fragment 4 (offset 468)
002268.284: dtdebug: merge_fragment(/aliases,/fragment@4/__overlay__)
002268.311: dtdebug: +prop(serial0)
002270.742: dtdebug: +prop(serial1)
002273.193: dtdebug: merge_fragment() end


Bob Anton

DirkS
Posts: 7548
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Devices /dev/serial0 and /dev/serial1 are not being crea

Sun May 15, 2016 1:30 pm

AIUI BT did not change from AMA0 to serial1.
To make the situation more predictable the BT device (which can be ttyAMA0 or ttyS0, depending on your setup) is always linked to /dev/serial1
This is done with a udev rule.
Is /etc/udev/rules.d/99-com.rules present on your system?

rkanton
Posts: 9
Joined: Tue Apr 30, 2013 4:05 pm

Re: Devices /dev/serial0 and /dev/serial1 are not being crea

Sun May 15, 2016 4:54 pm

No I don't have the /etc/udev/rules.d/99-com.rules udev file on my system. If you don't mind could you reply with the contents of the file. That way I can recreate it.

DirkS, do you know what apt package the file should have been included in?

rkanton
Posts: 9
Joined: Tue Apr 30, 2013 4:05 pm

Re: Devices /dev/serial0 and /dev/serial1 are not being crea

Sun May 15, 2016 7:08 pm

Thanks for the hint DirkS

I did a apt-file search to find the package:
> apt-file search 99-com.rules
raspberrypi-sys-mods: /etc/udev/rules.d/99-com.rules

then installed the package:
> apt-get install raspberrypi-sys-mods

Now I have the 99-com.rules, which indeed does create the /dev/serial0 and /dev/serial1 special files.

SOLVED/CLOSED

DirkS
Posts: 7548
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Devices /dev/serial0 and /dev/serial1 are not being crea

Mon May 16, 2016 11:21 am

Good to see you got it sorted.
BTW: the udev rules in that file also make changes for sudo-less GPIO access.

Return to “Troubleshooting”

Who is online

Users browsing this forum: salvaliebana and 38 guests