"can't open /dev/ttyO2: No such file or directory"

Hello,

I've successfully built Kernel 3.0, using the patches provided in meta-
texasinstruments GIT repo. I've also built U-boot 2011.06 (also with
some patches from the same repo). Finally, I've build a base file
system using build-root. Everything seems to work well, Kernel shows
all messages, network turns up, but when it is to launch getty for
login prompt, it stucks forever showing each second:

can't open /dev/ttyO2: No such file or directory
can't open /dev/ttyO2: No such file or directory
...

Is there a known solution for that? May I should attach more details?

Thanks!

In your config did you enable the omap serial driver? (ttyO2)
otherwise you may just have the older "generic" serial driver
enabled.. (ttyS2)..

Regards,

Yes, I have enabled it. When kernel boots up, omap-serial messages
appear identifying each ttyO.
The only thread I've found with a similar problem is
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42645.html .
However, the solution is not clearly explained.

________________________________
From: Robert Nelson <robertcnelson@gmail.com>
To: beagleboard@googlegroups.com
Sent: Friday, 5 August 2011, 15:08
Subject: Re: [beagleboard] "can't open /dev/ttyO2: No such file or
directory"

Hello,

I've successfully built Kernel 3.0, using the patches provided in meta-
texasinstruments GIT repo. I've also built U-boot 2011.06 (also with
some patches from the same repo). Finally, I've build a base file
system using build-root. Everything seems to work well, Kernel shows
all messages, network turns up, but when it is to launch getty for
login prompt, it stucks forever showing each second:

can't open /dev/ttyO2: No such file or directory
can't open /dev/ttyO2: No such file or directory

That looks like a capitol letter o (the letter before p). Should it not be a
zero?

Nope, it's a capital O, as in the letter after P.

Have a look at arch/arm/plat-omap/include/plat/omap-serial.h for the following:

/*
* Use tty device name as ttyO, [O -> OMAP]
* in bootargs we specify as console=ttyO0 if uart1
* is used as console uart.
*/
#define OMAP_SERIAL_NAME "ttyO"

Yes, I have enabled it. When kernel boots up, omap-serial messages
appear identifying each ttyO.
The only thread I've found with a similar problem is
[HELP-OMAP-SERAIL] beagleboard-xM can't boot up after update to kernel-2.6.37 .
However, the solution is not clearly explained.

That message just reiterates what Robert already said.

Maybe this is a udev problem? If your network comes up, SSH into the
board and poke around...

It should be “zero2”. How and why it’s that way I don’t know as ls -l /dev/tty* will return /dev/tty /dev/tty1 /dev/tty2 etc.
Regards
Sid.

Oops, it /dev/tty_2.

l /dev/ttyO*

crw-rw---- 1 root dialout 252, 0 2011-06-27 15:36 /dev/ttyO0
crw-rw---- 1 root dialout 252, 1 2011-06-27 15:36 /dev/ttyO1
crw------- 1 root tty 252, 2 2011-08-04 16:16 /dev/ttyO2
crw-rw---- 1 root dialout 252, 3 2011-06-27 15:36 /dev/ttyO3

Regards
Sid.

It should be "zero2". How and why it's that way I don't know as ls -l /dev/tty* will return /dev/tty /dev/tty1 /dev/tty2 etc.

Hogwash. From my BeagleBoard, running Yocto with 2.6.37 kernel:
root@beagleboard:~# ls -l /dev/tty*
crw-rw-rw- 1 root tty 5, 0 Jul 26 13:23 /dev/tty
crw--w---- 1 root root 4, 0 Jul 26 13:23 /dev/tty0
crw--w--w- 1 root root 4, 1 Aug 4 00:26 /dev/tty1
crw--w---- 1 root tty 4, 10 Jul 26 13:23 /dev/tty10
crw--w---- 1 root tty 4, 11 Jul 26 13:23 /dev/tty11
crw--w---- 1 root tty 4, 12 Jul 26 13:23 /dev/tty12
crw--w---- 1 root tty 4, 13 Jul 26 13:23 /dev/tty13
crw--w---- 1 root tty 4, 14 Jul 26 13:23 /dev/tty14
crw--w---- 1 root tty 4, 15 Jul 26 13:23 /dev/tty15
crw--w---- 1 root tty 4, 16 Jul 26 13:23 /dev/tty16
crw--w---- 1 root tty 4, 17 Jul 26 13:23 /dev/tty17
crw--w---- 1 root tty 4, 18 Jul 26 13:23 /dev/tty18
crw--w---- 1 root tty 4, 19 Jul 26 13:23 /dev/tty19
crw--w---- 1 root tty 4, 2 Jul 26 13:23 /dev/tty2
    ...
crw--w---- 1 root tty 4, 63 Jul 26 13:23 /dev/tty63
crw--w---- 1 root tty 4, 7 Jul 26 13:23 /dev/tty7
crw--w---- 1 root tty 4, 8 Jul 26 13:23 /dev/tty8
crw--w---- 1 root tty 4, 9 Jul 26 13:23 /dev/tty9
crw------- 1 root root 253, 0 Aug 4 00:26 /dev/ttyO0
crw-rw---- 1 root dialout 253, 1 Jul 26 13:23 /dev/ttyO1
crw-rw---- 1 root dialout 253, 2 Jul 26 13:23 /dev/ttyO2
crw-rw---- 1 root dialout 4, 64 Jul 26 13:23 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Jul 26 13:23 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Jul 26 13:23 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Jul 26 13:23 /dev/ttyS3

These devices are all created by udev when the system boots. If you're
not getting a list like this, it's a udev problem.

As other people say, it is a capital "O", not a zero. Is it possible
that I have both, old generic and new enabled? I can see one message
from 8250 driver at startup, prior to omap-serial messages. I cannot
remove 8250 driver from menuconfig hm.. Probably some dependency?

Thanks.

Hi, Gerard I’ve got the same problem that you.

MLO: U-Boot SPL 2011.12-00201-g137703b-dirty
U-Boot: U-Boot 2011.12-00201-g137703b-dirty

Kernel: Linux-3.3.0-rc1-00287-gacb42a3

And roofs made with buildroot: Linux-3.3.0-rc1-00287-gacb42a3

MLO and U-boot work fine but after of load uImage appears this message:

[ 5.314727] EXT3-fs (mmcblk0p2): using internal journal

[ 5.325714] EXT3-fs (mmcblk0p2): recovery complete

[ 5.330902] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode

[ 5.338928] VFS: Mounted root (ext3 filesystem) on device 179:2.

[ 5.345916] Freeing init memory: 304K

Starting logging: OK

Initializing random number generator…

done.

Starting network…

run-parts: /etc/network/if-post-up.d: No such file or directory

Starting network time protocol daemon: ntpd.

Starting dropbear sshd:

OK

can’t open /dev/ttyO2: No such file or directory

can’t open /dev/ttyO2: No such file or directory

Did you solve the problem?

Thank you so much. Best regards.

I faced the same issue.

I have built my rootfs using buildroot. The kernel image, MLO, and UBoot were built externally. And also the toolchain were used externally.

In my case, after the kernel boots(NFS-boot), before the login prompt, the serial terminal fails and the error is printed continuously “Can’t open /dev/ttyO0. No such file or directory”.
And I coudnt operate the system with my terminal(minicom). Luckily I installed ssh, so I could log in to the system using ssh. Then I used dmesg to see some logs:

dmesg | grep tty

I found this message: WARNING: Your ‘console=ttyO0’ has been replaced by ‘ttyS0’
So I just tried to rename my ttyS0 with ttyO0 back again. Magically my serial terminal was back to control. I don’t know the details of how it worked but it did work.
All I have to find out is to let the kernel identify the appropriate tty device file correctly.

FYI, I am a beginner in Embedded Linux and Linux kernel as a whole so please bear with me.

Thank you.